From 344c1cbaf1e12a8c7f480e4fd97d13e693b7d37f Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Wed, 7 May 2014 10:22:50 +0100 Subject: [PATCH] elua: more informative getopt --- src/bin/elua/modules/getopt.lua | 6 ++++-- src/bin/elua/xgettext.lua | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/elua/modules/getopt.lua b/src/bin/elua/modules/getopt.lua index 01327a1352..393a13e9ed 100644 --- a/src/bin/elua/modules/getopt.lua +++ b/src/bin/elua/modules/getopt.lua @@ -49,7 +49,8 @@ local parse_l = function(opts, opt, descs, args, parser) if desc.callback then rets = { desc:callback(parser, optval) } end if not rets or #rets == 0 then rets = { optval } end local optn = desc.alias or desc[1] or desc[2] - opts[#opts + 1] = { optn, unpack(rets) } + opts[#opts + 1] = { optn, short = desc[1], long = desc[2], + alias = desc.alias, unpack(rets) } local optret = #rets > 1 and rets or rets[1] if desc.list then desc.list[#desc.list + 1] = optret @@ -83,7 +84,8 @@ local parse_s = function(opts, optstr, descs, args, parser) if desc.callback then rets = { desc:callback(parser, optval) } end if not rets or #rets == 0 then rets = { optval } end local optn = desc.alias or desc[1] or desc[2] - opts[#opts + 1] = { optn, unpack(rets) } + opts[#opts + 1] = { optn, short = desc[1], long = desc[2], + alias = desc.alias, unpack(rets) } local optret = #rets > 1 and rets or rets[1] if desc.list then desc.list[#desc.list + 1] = optret diff --git a/src/bin/elua/xgettext.lua b/src/bin/elua/xgettext.lua index 1dca2e2f4b..ecba552bdb 100644 --- a/src/bin/elua/xgettext.lua +++ b/src/bin/elua/xgettext.lua @@ -165,7 +165,7 @@ end local hasxgettext = os.getenv("XGETTEXT") if hasxgettext then - local gargs = { hasxgettext } + local gargs = { hasxgettext, "--join-existing" } for i = 1, #opts do gargs[#gargs + 1] = arg[i] end