Added help message generation; Improved optional arguments handling.

This commit is contained in:
mpeterv
2014-01-26 15:20:42 +04:00
parent d279429896
commit 404ec5213a
5 changed files with 116 additions and 3 deletions

View File

@@ -185,6 +185,7 @@ describe("tests related to options", function()
it("handles unknown options correctly", function()
local parser = argparse.parser()
:add_help(false)
assert.has_error(function() parser:parse{"--server"} end, "unknown option '--server'")
assert.has_error(function() parser:parse{"--server=localhost"} end, "unknown option '--server'")
assert.has_error(function() parser:parse{"-s"} end, "unknown option '-s'")