[latex3-commits] [latex3/l3sys-query] main: Issue short error msg for unknown cmd (99f08e4)

github at latex-project.org github at latex-project.org
Thu Mar 7 09:02:07 CET 2024


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

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

commit 99f08e4e72edf5c4619b7e8739c21a57f29d2763
Author: Joseph Wright <joseph at texdev.net>
Date:   Thu Mar 7 08:01:54 2024 +0000

    Issue short error msg for unknown cmd


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

99f08e4e72edf5c4619b7e8739c21a57f29d2763
 l3sys-query.lua | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/l3sys-query.lua b/l3sys-query.lua
index 159ed42..10978f4 100755
--- a/l3sys-query.lua
+++ b/l3sys-query.lua
@@ -197,7 +197,7 @@ local function glob_to_pattern(glob)
 end
 
 -- Initial data for the command line parser
-local cmd = "help"
+local cmd = ""
 local options = {}
 local spec = ""
 
@@ -531,7 +531,12 @@ if cmd == "version" then
   version()
   exit(0)
 elseif not cmd_impl[cmd] then
-  help()
+  if cmd == "" then
+    help()
+  else
+    stderr:write(script_name .. ": '" .. cmd .. "' is not a " .. script_name ..
+      " command. See '" .. script_name .. " --help'.")
+  end
   exit(1)
 end
 





More information about the latex3-commits mailing list.