Skip to content

Commit

Permalink
keep help on stdout unless error
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed Dec 27, 2013
1 parent 18a3723 commit 5461bd1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bin/moonc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5461bd1

Please sign in to comment.