mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 11:02:20 +00:00
Fix option combining
Interpret '-f123' as '-f 123' if '-f' option can take an argument, even when it can be used without one as well.
This commit is contained in:
@@ -1107,7 +1107,7 @@ function ParseState:parse(args)
|
|||||||
local option = self:get_option(name)
|
local option = self:get_option(name)
|
||||||
self:invoke(option, name)
|
self:invoke(option, name)
|
||||||
|
|
||||||
if i ~= #arg and option.element._minargs > 0 and option.element._maxargs > 0 then
|
if i ~= #arg and option.element._maxargs > 0 then
|
||||||
self:pass(arg:sub(i + 1))
|
self:pass(arg:sub(i + 1))
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user