]> git.e2factory.org Git - e2factory.git/commitdiff
Forbid --all with results and --wc-mode without results
authorTobias Ulmer <tu@emlix.com>
Tue, 25 Mar 2014 16:34:07 +0000 (17:34 +0100)
committerTobias Ulmer <tu@emlix.com>
Tue, 25 Mar 2014 17:07:54 +0000 (18:07 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/e2-build.lua

index 2d7e817e0003cea22e12e9b3ce40dd8885b003fb..7879561b671dea557a7f3ffd2feea5e71255d7e5 100644 (file)
@@ -113,7 +113,10 @@ end
 
 -- handle result selection
 local results = {}
-if opts["all"] then
+
+if opts["all"] and #arguments ~= 0 then
+    e2lib.abort("--all with additional results does not make sense")
+elseif opts["all"] then
     for r,_ in pairs(info.results) do
         table.insert(results, r)
     end
@@ -134,6 +137,9 @@ if opts["branch-mode"] then
     build_mode = policy.default_build_mode("branch")
 end
 if opts["wc-mode"] then
+    if #results == 0 then
+        e2lib.abort("--wc-mode requires one or more results")
+    end
     build_mode = policy.default_build_mode("working-copy")
 end
 local playground = opts["playground"]