diff --git a/src/bin/elua/modules/getopt.lua b/src/bin/elua/modules/getopt.lua index f145ff9250..f7288e0a5b 100644 --- a/src/bin/elua/modules/getopt.lua +++ b/src/bin/elua/modules/getopt.lua @@ -58,6 +58,11 @@ local parse_l = function(opts, opt, descs, args, parser) else opts[optn] = optret or true end + local dopts = desc.opts + if dopts then + dopts[#opts + 1] = opts[#opts] + dopts[optn] = opts[optn ] + end end local parse_s = function(opts, optstr, descs, args, parser) @@ -92,6 +97,11 @@ local parse_s = function(opts, optstr, descs, args, parser) else opts[optn] = optret or true end + local dopts = desc.opts + if dopts then + dopts[#dopts + 1] = opts[#opts] + dopts[optn] = opts[optn ] + end end end