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:
mpeterv
2015-10-30 15:13:30 +03:00
parent 93522f1856
commit babe715548
5 changed files with 12 additions and 9 deletions

View File

@@ -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)