mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +00:00
Reorder properties
Move more common properties to the front of property lists, so that they can be passed as constructor arguments. E.g. parser:option "-p" "--port" :description "Port number." :default "8080" :convert(tonumber) can now be expressed as parser:option("-p --port", "Port number.", "8080", tonumber)
This commit is contained in:
@@ -60,10 +60,7 @@ describe("tests related to default values", function()
|
||||
|
||||
it("handles option with default value for multi-argument option correctly", function()
|
||||
local parser = Parser()
|
||||
parser:option "-s" "--several" {
|
||||
default = "foo",
|
||||
args = "2-3"
|
||||
}
|
||||
parser:option("-s --several", "Two or three things", "foo", nil, "2-3")
|
||||
local args = parser:parse{}
|
||||
assert.same({several = {"foo", "foo"}}, args)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user