mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-31 04:22:18 +00:00
Lua 5.0 compatibility flag strikes again
This commit is contained in:
@@ -574,8 +574,10 @@ local function plural(x)
|
|||||||
return "s"
|
return "s"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local default_cmdline = arg or {}
|
||||||
|
|
||||||
function Parser:_parse(args, errhandler)
|
function Parser:_parse(args, errhandler)
|
||||||
args = args or arg
|
args = args or default_cmdline
|
||||||
local parser
|
local parser
|
||||||
local charset
|
local charset
|
||||||
local options = {}
|
local options = {}
|
||||||
@@ -916,5 +918,5 @@ function Parser:pparse(args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
return function(...)
|
return function(...)
|
||||||
return Parser(arg and arg[0]):add_help(true)(...)
|
return Parser(default_cmdline[0]):add_help(true)(...)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user