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")