projects
/
ganeti-local
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
edb4b37
)
Show "--help" in bash completion
author
Michael Hanselmann
<hansmi@google.com>
Wed, 16 Sep 2009 15:39:03 +0000
(17:39 +0200)
committer
Michael Hanselmann
<hansmi@google.com>
Wed, 16 Sep 2009 16:13:16 +0000
(18:13 +0200)
Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
autotools/build-bash-completion
patch
|
blob
|
history
diff --git
a/autotools/build-bash-completion
b/autotools/build-bash-completion
index
7368dab
..
cb738cd
100755
(executable)
--- a/
autotools/build-bash-completion
+++ b/
autotools/build-bash-completion
@@
-584,6
+584,14
@@
def GetCommands(filename, module):
raise Exception("Script %s doesn't have 'commands' attribute" %
filename)
+ # Add the implicit "--help" option
+ help_option = cli.cli_option("-h", "--help", default=False,
+ action="store_true")
+
+ for (_, _, optdef, _, _) in commands.itervalues():
+ if help_option not in optdef:
+ optdef.append(help_option)
+
# Use aliases
aliases = getattr(module, "aliases", {})
if aliases: