elua: more checks

This commit is contained in:
Daniel Kolesa 2014-05-07 10:41:19 +01:00 committed by Daniel Kolesa
parent 69a64dd620
commit 38ae60f744
1 changed files with 5 additions and 2 deletions

View File

@ -159,7 +159,7 @@ local opts, args = getopt.parse {
}
}
if not opts or opts["h"] or opts["v"] then
if not opts or opts["h"] or opts["v"] or #args == 0 then
return true
end
@ -199,12 +199,15 @@ if hasxgettext and not onlylua then
for i, opt in ipairs(opts) do
gargs[#gargs + 1] = build_opt(opt)
end
local ngargs = #gargs
for i, v in ipairs(args) do
if not v:match("^.+%.lua$") then
gargs[#gargs + 1] = v
end
end
cutil.exec(unpack(gargs))
if #gargs ~= ngargs then
cutil.exec(unpack(gargs))
end
end
return true