mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
keep help on stdout unless error
This commit is contained in:
parent
18a3723f00
commit
5461bd179b
10
bin/moonc
10
bin/moonc
@ -40,12 +40,16 @@ if opts.v then
|
||||
end
|
||||
|
||||
function print_help(err)
|
||||
local help_msg = help:format(arg[0])
|
||||
|
||||
if err then
|
||||
io.stderr:write("Error: ".. err .. "\n")
|
||||
io.stderr:write(help_msg .. "\n")
|
||||
os.exit(1)
|
||||
else
|
||||
print(help_msg)
|
||||
os.exit(0)
|
||||
end
|
||||
|
||||
io.stderr:write(help:format(arg[0]) .. "\n")
|
||||
os.exit(1)
|
||||
end
|
||||
|
||||
function mkdir(path)
|
||||
|
Loading…
Reference in New Issue
Block a user