Skip to content

Commit 2a0e0d7

Browse files
committed
Fix #461: printing version doens't work with args
1 parent 74e1e55 commit 2a0e0d7

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

bin/moonc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ parser:flag("-",
2626
local read_stdin = arg[1] == "-" -- luacheck: ignore 113
2727

2828
if not read_stdin then
29-
parser:argument("file/directory"):args("+")
29+
parser:argument("file/directory"):args("*")
3030
else
3131
if arg[2] ~= nil then
3232
io.stderr:write("- must be the only argument\n")
@@ -42,6 +42,11 @@ if opts.version then
4242
os.exit()
4343
end
4444

45+
if not read_stdin and #opts["file/directory"] == 0 then
46+
io.stderr:write(parser:get_help())
47+
os.exit()
48+
end
49+
4550
function log_msg(...)
4651
if not opts.p then
4752
io.stderr:write(table.concat({...}, " ") .. "\n")

0 commit comments

Comments
 (0)