mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +00:00
If an option with a default value is underused, invoke it more
This commit is contained in:
@@ -42,6 +42,15 @@ describe("tests related to default values", function()
|
||||
assert.same({foo = "bar"}, args)
|
||||
end)
|
||||
|
||||
it("handles underused option with default value correctly", function()
|
||||
local parser = Parser()
|
||||
parser:option "-o" "--output"
|
||||
:count(1)
|
||||
:default "a.out"
|
||||
local args = parser:parse{}
|
||||
assert.same({output = "a.out"}, args)
|
||||
end)
|
||||
|
||||
it("doesn't use default if option is not invoked", function()
|
||||
local parser = Parser()
|
||||
parser:option("-f", "--foo", {
|
||||
|
Reference in New Issue
Block a user