System queries with Lua: l3sys-query

Karl Berry karl at
Thu Mar 7 00:13:45 CET 2024

Here are my non-security comments.

- Both --help and --version start with a blank line. It's better not to do
this, so that |sed 1q and the like can do something useful. There are
scripts that collect that info.

- If bad option or missing argument, don't give full help message.
Instead, a la most GNU programs:

  cp: missing file operand
  Try 'cp --help' for more information.

  cp: unrecognized option '--x'
  Try 'cp --help' for more information.

- If options are given with the pwd <cmd>, give an error message instead
of silently ignoring:
$ texlua l3sys-query.lua pwd -r

- Similarly with unrecognized commands. "texlua l3sys-query.lua foo"
should say something like "l3sys-query: unrecognized command: foo".

- In the --help msg, please give a sentence or two about what the program
does, e.g. (if more features are added later, could be generalized):
   Output the name or listing of the current directory.

- In the --help, please explain what a <spec> is. Or use <glob>,
and then explain that [...] is not supported (I gather).

- I suggest "Valid <cmd>s are:" instead of "Valid commands",
likewise "Valid <options> are:", to refer back to the syntax line.

Apparently --sort takes an option, but the --help msg doesn't say that,
or explain what it can be.

   --sort            Method used to sort directory listing

   --sort <type>     Method used to sort directory listing
Ditto for --exclude, --type, any other options that take arguments.
It's best, and conventional, to actually list the allowed values, but if
you don't want to do that, at least indicate that an argument is

I imagine it's all explained in the manual, but ...

Please don't forget to make a man page. --thanks, karl.

More information about the tex-live mailing list.