When I use the following:
local argparse = require "argparse"
local parser = argparse()
parser:option("--interactive", "Wait for user input.", true):choices{true, false}
local args = parser:parse()
Everything appears to work fine unless I use the built-in -h or --help to display help text, which returns:
luajit: ./argparse.lua:497: invalid value (boolean) at index 1 in table for 'concat'
stack traceback:
[C]: in function 'concat'
./argparse.lua:497: in function '_get_default_argname'
./argparse.lua:487: in function '_get_argname'
./argparse.lua:376: in function '_get_argument_list'
./argparse.lua:576: in function '_get_usage'
./argparse.lua:753: in function 'add_element'
./argparse.lua:783: in function 'get_usage'
./argparse.lua:1003: in function 'get_help'
./argparse.lua:233: in function 'action'
./argparse.lua:1793: in function 'close'
./argparse.lua:1722: in function 'invoke'
./argparse.lua:1906: in function 'invoke'
./argparse.lua:2025: in function 'parse'
./installer.lua:17: in main chunk
[C]: at 0x57c0bf72e0c0
Using a boolean default doesn't cause this error, but the choices appear to cause the problem.
(Edited to fix an error in my usage that is unrelated to this bug.)
When I use the following:
Everything appears to work fine unless I use the built-in
-hor--helpto display help text, which returns:Using a boolean default doesn't cause this error, but the
choicesappear to cause the problem.(Edited to fix an error in my usage that is unrelated to this bug.)