From 2d5e7ae14d9eb59d1f52ad90b802bdf95816e62d Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 17 Sep 2009 13:30:18 +0200
Subject: [PATCH] =?UTF-8?q?Move=20the=20=E2=80=9C--all=E2=80=9D=20option?=
 =?UTF-8?q?=20to=20cli.py?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 lib/cli.py           | 7 +++++++
 scripts/gnt-instance | 8 ++------
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/lib/cli.py b/lib/cli.py
index dc548dec8..2d6dc220a 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -44,6 +44,7 @@ from optparse import (OptionParser, TitledHelpFormatter,
 
 __all__ = [
   # Command line options
+  "ALL_OPT",
   "BACKEND_OPT",
   "CLEANUP_OPT",
   "CONFIRM_OPT",
@@ -617,6 +618,12 @@ STATIC_OPT = cli_option("-s", "--static", dest="static",
                         action="store_true", default=False,
                         help="Only show configuration data, not runtime data")
 
+ALL_OPT = cli_option("--all", dest="show_all",
+                     default=False, action="store_true",
+                     help="Show info on all instances on the cluster."
+                     " This can take a long time to run, use wisely")
+
+
 
 def _ParseArgs(argv, commands, aliases):
   """Parser for the command line arguments.
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index 646013d9a..0a1e5ee3c 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1404,12 +1404,8 @@ commands = {
            "Move instance to an arbitrary node"
            " (only for instances of type file and lv)"),
   'info': (ShowInstanceConfig, ARGS_MANY_INSTANCES,
-           [DEBUG_OPT, STATIC_OPT,
-            cli_option("--all", dest="show_all",
-                       default=False, action="store_true",
-                       help="Show info on all instances on the cluster."
-                       " This can take a long time to run, use wisely."),
-            ], "[-s] {--all | <instance>...}",
+           [DEBUG_OPT, STATIC_OPT, ALL_OPT],
+           "[-s] {--all | <instance>...}",
            "Show information on the specified instance(s)"),
   'list': (ListInstances, ARGS_MANY_INSTANCES,
            [DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT],
-- 
GitLab