mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +00:00
Change error messages for missing elements
* For arguments: "argument 'foo' is required" -> "missing argument 'foo'" * For options: "option '--foo' must be used at least 1 time" -> "missing option '--foo'"
This commit is contained in:
@@ -298,7 +298,8 @@ describe("tests related to options", function()
|
||||
parser:option "-f" "--foo" {
|
||||
count = "3-4"
|
||||
}
|
||||
assert.has_error(function() parser:parse{"-fFOO", "-fBAR"} end, "option '-f' must be used at least 3 times")
|
||||
assert.has_error(function() parser:parse{"-fFOO", "--foo=BAR"} end, "option '--foo' must be used at least 3 times")
|
||||
assert.has_error(function() parser:parse{} end, "missing option '-f'")
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user