From 2a0e0d7047f4dff64cb3be1a3829768f711f4b78 Mon Sep 17 00:00:00 2001 From: qaisjp Date: Sat, 10 Jan 2026 17:42:36 -0500 Subject: [PATCH] Fix #461: printing version doens't work with args --- bin/moonc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/moonc b/bin/moonc index 44f412d..313a650 100644 --- a/bin/moonc +++ b/bin/moonc @@ -26,7 +26,7 @@ parser:flag("-", local read_stdin = arg[1] == "-" -- luacheck: ignore 113 if not read_stdin then - parser:argument("file/directory"):args("+") + parser:argument("file/directory"):args("*") else if arg[2] ~= nil then io.stderr:write("- must be the only argument\n") @@ -42,6 +42,11 @@ if opts.version then os.exit() end +if not read_stdin and #opts["file/directory"] == 0 then + io.stderr:write(parser:get_help()) + os.exit() +end + function log_msg(...) if not opts.p then io.stderr:write(table.concat({...}, " ") .. "\n")