gracefully handle nil input in argparse.stringList

develop
Myk Taylor 2023-12-31 01:17:42 -08:00
parent a970161585
commit 02c692150b
No known key found for this signature in database
1 changed files with 1 additions and 1 deletions

@ -130,7 +130,7 @@ end
function stringList(arg, arg_name, list_length)
if not list_length then list_length = 0 end
local list = arg:split(',')
local list = arg and (arg):split(',') or {}
if list_length > 0 and #list ~= list_length then
arg_error(arg_name,
'expected %d elements; found %d', list_length, #list)