elua: more checks
authorDaniel Kolesa <quaker66@gmail.com>
Wed, 7 May 2014 09:41:19 +0000 (10:41 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Tue, 10 Jun 2014 14:48:50 +0000 (15:48 +0100)
src/bin/elua/xgettext.lua

index 922378d..56f36af 100644 (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
\ No newline at end of file