From d48031a1e38423bcd1f3717eda7b883d83a6cb61 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Tue, 26 May 2009 17:00:16 +0200
Subject: [PATCH] Add a new CONFIRM_OPT option to cli.py
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Today we are not very consistent as to what β€˜--force’ represents:
sometimes confirmation, sometimes forcing a possible dangerous option,
etc.

This patch adds a new β€˜--yes’ option that should be used for all simple
confirmations of genre β€œyes, I really want to remove the instance”.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/cli.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/cli.py b/lib/cli.py
index 4f68167f9..281fb5c8b 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -51,7 +51,7 @@ __all__ = ["DEBUG_OPT", "NOHDR_OPT", "SEP_OPT", "GenericMain",
            "FormatError", "SplitNodeOption", "SubmitOrSend",
            "JobSubmittedException", "FormatTimestamp", "ParseTimespec",
            "ToStderr", "ToStdout", "UsesRPC",
-           "GetOnlineNodes", "JobExecutor", "SYNC_OPT",
+           "GetOnlineNodes", "JobExecutor", "SYNC_OPT", "CONFIRM_OPT",
            ]
 
 
@@ -182,6 +182,9 @@ FIELDS_OPT = make_option("-o", "--output", dest="output", action="store",
 FORCE_OPT = make_option("-f", "--force", dest="force", action="store_true",
                         default=False, help="Force the operation")
 
+CONFIRM_OPT = make_option("--yes", dest="confirm", action="store_true",
+                          default=False, help="Do not require confirmation")
+
 TAG_SRC_OPT = make_option("--from", dest="tags_source",
                           default=None, help="File with tag names")
 
-- 
GitLab