On Thu, Sep 17, 2009 at 03:31:49PM +0100, Michael Hanselmann wrote:
> 2009/9/17 Michael Hanselmann <[email protected]>:
> > 2009/9/17 Iustin Pop <[email protected]>:
> >> Since >90% of the commands take the “--debug” option, and all should
> >> actually take it (the gnt-job command is currently missing it), it makes
> >> sense to simply remove this and add it by default in cli.py.
> >
> > LGTM
>
> Actually, please make sure to add this to bash completion, too,
> similar to --help.
Here's the interdiff, with some fixes beside that (left DEBUG_OPT in
some places):
diff --git a/autotools/build-bash-completion b/autotools/build-bash-completion
index cb738cd..c94ad26 100755
--- a/autotools/build-bash-completion
+++ b/autotools/build-bash-completion
@@ -591,6 +591,8 @@ def GetCommands(filename, module):
for (_, _, optdef, _, _) in commands.itervalues():
if help_option not in optdef:
optdef.append(help_option)
+ if cli.DEBUG_OPT not in optdef:
+ optdef.append(cli.DEBUG_OPT)
# Use aliases
aliases = getattr(module, "aliases", {})
diff --git a/scripts/gnt-backup b/scripts/gnt-backup
index 194d037..ae5c601 100755
--- a/scripts/gnt-backup
+++ b/scripts/gnt-backup
@@ -210,7 +210,6 @@ def RemoveExport(opts, args):
# this is defined separately due to readability only
import_opts = [
- DEBUG_OPT,
NODE_PLACEMENT_OPT,
BACKEND_OPT,
DISK_TEMPLATE_OPT,
diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster
index e1929b3..58a9b9f 100755
--- a/scripts/gnt-cluster
+++ b/scripts/gnt-cluster
@@ -610,7 +610,7 @@ commands = {
"<new_name>",
"Renames the cluster"),
'redist-conf': (
- RedistributeConfig, ARGS_NONE, [DEBUG_OPT, SUBMIT_OPT],
+ RedistributeConfig, ARGS_NONE, [SUBMIT_OPT],
"", "Forces a push of the configuration file and ssconf files"
" to the nodes in the cluster"),
'verify': (
@@ -646,7 +646,7 @@ commands = {
'list-tags': (
ListTags, ARGS_NONE, [], "", "List the tags of the cluster"),
'add-tags': (
- AddTags, [ArgUnknown()], [DEBUG_OPT, TAG_SRC_OPT],
+ AddTags, [ArgUnknown()], [TAG_SRC_OPT],
"tag...", "Add tags to the cluster"),
'remove-tags': (
RemoveTags, [ArgUnknown()], [TAG_SRC_OPT],
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index a51fcf4..407967e 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1442,7 +1442,7 @@ commands = {
"Replaces all disks for the instance"),
'modify': (
SetInstanceParams, ARGS_ONE_INSTANCE,
- [DEBUG_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT],
+ [DISK_OPT, FORCE_OPT, HVOPTS_OPT, NET_OPT, SUBMIT_OPT],
"<instance>", "Alters the parameters of an instance"),
'shutdown': (
ShutdownInstance, [ArgInstance(min=1)],
--
iustin