mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +00:00
Remove 'aliases' property
Allow setting several names using 'name' property instead, e.g. ':name "-f --foo"' instead of ':aliases {"-f", "--foo"}'. This change breaks documented interface of 0.3.x.
This commit is contained in:
@@ -4,7 +4,7 @@ getmetatable(Parser()).error = function(_, msg) error(msg) end
|
||||
describe("tests related to :pparse()", function()
|
||||
it("returns true and result on success", function()
|
||||
local parser = Parser()
|
||||
parser:option "-s" "--server"
|
||||
parser:option "-s --server"
|
||||
local ok, args = parser:pparse{"--server", "foo"}
|
||||
assert.is_true(ok)
|
||||
assert.same({server = "foo"}, args)
|
||||
@@ -20,8 +20,8 @@ describe("tests related to :pparse()", function()
|
||||
|
||||
it("still raises an error if it is caused by misconfiguration", function()
|
||||
local parser = Parser()
|
||||
parser:option "--foo"
|
||||
:aliases {1, 2, 3}
|
||||
assert.has_error(function() parser:pparse{} end)
|
||||
parser:flag "--foo"
|
||||
:action(error)
|
||||
assert.has_error(function() parser:pparse{"--foo"} end)
|
||||
end)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user