mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-30 03:52:19 +00:00
more tests, fixed some incorrect behaviour
This commit is contained in:
@@ -250,7 +250,7 @@ function Parser:parse(args)
|
||||
element = self:assert(state.context[name], "unknown option " .. name)
|
||||
state:handle_option(name)
|
||||
|
||||
if i ~= #data and not (element:can_take(0) and data:sub(i+1, i+1):match "[a-zA-Z]") then
|
||||
if i ~= #data and not (element.minargs == 0 and data:sub(i+1, i+1):match "[a-zA-Z]") then
|
||||
state:handle_argument(data:sub(i+1))
|
||||
break
|
||||
end
|
||||
|
@@ -65,7 +65,7 @@ function State:get_result()
|
||||
result[element.target] = invocations[1][1]
|
||||
end
|
||||
else
|
||||
result[element.target] = invocations[1] or {}
|
||||
result[element.target] = invocations[1]
|
||||
end
|
||||
else
|
||||
if element.maxargs == 0 then
|
||||
|
Reference in New Issue
Block a user