From 9f7feddc8dd38bf463e5e6432de38f5d1e99b4f4 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Tue, 25 Mar 2014 17:34:07 +0100 Subject: [PATCH] Forbid --all with results and --wc-mode without results Signed-off-by: Tobias Ulmer --- local/e2-build.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/local/e2-build.lua b/local/e2-build.lua index 2d7e817..7879561 100644 --- a/local/e2-build.lua +++ b/local/e2-build.lua @@ -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"] -- 2.39.5