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
|
end
|
||||||
|
|
||||||
function print_help(err)
|
function print_help(err)
|
||||||
|
local help_msg = help:format(arg[0])
|
||||||
|
|
||||||
if err then
|
if err then
|
||||||
io.stderr:write("Error: ".. err .. "\n")
|
io.stderr:write("Error: ".. err .. "\n")
|
||||||
|
io.stderr:write(help_msg .. "\n")
|
||||||
|
os.exit(1)
|
||||||
|
else
|
||||||
|
print(help_msg)
|
||||||
|
os.exit(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
io.stderr:write(help:format(arg[0]) .. "\n")
|
|
||||||
os.exit(1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function mkdir(path)
|
function mkdir(path)
|
||||||
|
Loading…
Reference in New Issue
Block a user