[latex3-commits] [latex3/l3sys-query] main: Remove --all option (8eee435)

github at latex-project.org github at latex-project.org
Sun Mar 10 21:20:06 CET 2024


Repository : https://github.com/latex3/l3sys-query
On branch  : main
Link       : https://github.com/latex3/l3sys-query/commit/8eee435fc4a7b9e66ede070a8c58331c3a987ef4

>---------------------------------------------------------------

commit 8eee435fc4a7b9e66ede070a8c58331c3a987ef4
Author: Joseph Wright <joseph at texdev.net>
Date:   Sun Mar 10 20:20:06 2024 +0000

    Remove --all option
    
    At present, use case is not made.


>---------------------------------------------------------------

8eee435fc4a7b9e66ede070a8c58331c3a987ef4
 l3sys-query.lua | 19 +------------------
 l3sys-query.tex | 11 ++++++-----
 2 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/l3sys-query.lua b/l3sys-query.lua
index 388db6c..6428871 100755
--- a/l3sys-query.lua
+++ b/l3sys-query.lua
@@ -118,10 +118,6 @@ local option_list =
 local io     = io
 local stderr = io.stderr
 
-local kpse             = kpse
-local set_program_name = kpse.set_program_name
-local var_value        = kpse.var_value
-
 local lfs        = lfs
 local attributes = lfs.attributes
 local currentdir = lfs.currentdir
@@ -143,17 +139,6 @@ local concat = table.concat
 local insert = table.insert
 local sort   = table.sort
 
---
--- Read security settings
---
-
-set_program_name("kpsewhich")
-local is_paranoid = false
-local open_mode = var_value("openin_any")
-if open_mode and open_mode ~= "a" then
-  is_paranoid = true
-end
-
 --
 -- Support functions and data
 --
@@ -487,13 +472,11 @@ function cmd_impl.ls(arg_list)
 
   -- Build a table of entries, excluding "." and "..", and return as a string
   -- with one entry per line.
-  local is_all = options.all and not is_paranoid
   local opt = options.type
   local is_rec = options.recursive
   local function browse(path)
     for entry in dir(path) do
-      if entry ~= "." and entry ~= ".."
-        and (is_all or not match(entry,"^%.")) then
+      if entry ~= "." and entry ~= ".." and not match(entry,"^%.") then
         local full_entry = path .. "/" .. entry
         local ft = attributes(full_entry,"mode")
         if not opt or ft == attrib_map[opt] then
diff --git a/l3sys-query.tex b/l3sys-query.tex
index 0c688cc..61a372c 100644
--- a/l3sys-query.tex
+++ b/l3sys-query.tex
@@ -101,7 +101,6 @@ use~|/|, irrespective of the platform in use.
 
 As well as these targets, the script recognizes the options
 \begin{itemize}
-  \item |--all| Include \enquote{dot} entries in directory listings
   \item |--exclude| Specification for directory entries to exclude
   \item |--ignore-case| Ignores case when sorting directory listings
   \item |--pattern| (|-p|) Treat the \meta{args} as Lua patterns rather
@@ -148,9 +147,10 @@ option, which should be given with a \meta{xarg}, for example
   l3sys-query ls --exclude '*.bak' 'graphics/*'
 \end{verbatim}
 Directory entries starting |.| are traditionally hidden on Linux and macOS
-systems: these \enquote{dot} entries are excluded unless the |--all| option is
-set. Note that this will skip hidden directories entirely when used with the
-|--recursive| option.
+systems: these \enquote{dot} entries are excluded from the output of
+\texttt{l3sys-query}. The entries |.| and |..| for the current and parent
+directory are also excluded from the results returned by \texttt{l3sys-query} as
+they can always be assumed.
 
 For more complex matching, the \meta{args} can be treated as a Lua pattern using
 the |--pattern| (|-p|) option; this also applies to the \meta{xarg} argument to
@@ -171,7 +171,8 @@ option. This takes a string argument, one of |d| (directory) or |f| (file).
 
 As standard, only the path specified as part of the \meta{args} is queried.
 However, if the |--recursive| (|-r|) option is set, the query is applied within
-all subdirectories.
+all subdirectories. Subdirectories starting with~|.| (macOS and Linux hidden)
+are excluded from recursion.
 
 For security reasons, only paths within the current working directory can be
 queried, this for example |graphics/*.png| will list all |png| files in the





More information about the latex3-commits mailing list.