q66 pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0f6cac43e5cb211a3fce4c3ecdd91eacc3eddd83
commit 0f6cac43e5cb211a3fce4c3ecdd91eacc3eddd83 Author: Daniel Kolesa <[email protected]> Date: Thu Dec 18 16:09:58 2014 +0000 elua: getopt updates --- src/scripts/elua/modules/getopt.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scripts/elua/modules/getopt.lua b/src/scripts/elua/modules/getopt.lua index ef16a8b..0a73fa2 100644 --- a/src/scripts/elua/modules/getopt.lua +++ b/src/scripts/elua/modules/getopt.lua @@ -87,8 +87,10 @@ local parse_l = function(opts, opt, descs, args, parser) if desc.list then desc.list[#desc.list + 1] = optret opts[optn] = desc.list + elseif optret ~= nil then + opts[optn] = optret else - opts[optn] = optret or true + opts[optn] = true end local dopts = desc.opts if dopts then @@ -106,6 +108,7 @@ local parse_s = function(opts, optstr, descs, args, parser) local argr = desc[3] if argr or argr == nil then if optstr == "" then + optstr = nil if #args == 0 then if argr then error("option -" .. opt .. " requires an argument", 3) @@ -128,8 +131,10 @@ local parse_s = function(opts, optstr, descs, args, parser) if desc.list then desc.list[#desc.list + 1] = optret opts[optn] = desc.list + elseif optret ~= nil then + opts[optn] = optret else - opts[optn] = optret or true + opts[optn] = true end local dopts = desc.opts if dopts then --
