Argname can be an array

This commit is contained in:
mpeterv
2014-03-08 16:04:40 +04:00
parent 2c7e655932
commit 2d0faa258d
2 changed files with 42 additions and 11 deletions

View File

@@ -143,5 +143,19 @@ describe("tests related to usage message generation", function()
parser:get_usage()
)
end)
it("uses array of argnames provided by user", function()
local parser = Parser "foo"
:add_help(false)
parser:option "--pair"
:args(2)
:count "*"
:argname{"<key>", "<value>"}
assert.equal(
[=[Usage: foo [--pair <key> <value>]]=],
parser:get_usage()
)
end)
end)
end)