Commit 1f4e391b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Show "--help" in bash completion


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent edb4b374
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment