aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/help.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2008-11-27 11:12:26 -0500
committerW. Trevor King <wking@drexel.edu>2008-11-27 11:12:26 -0500
commit7603adce0d52e387b8d0e14d881c1a7749a5f9e5 (patch)
tree62e9f022f235e7dd17033b1f04066bc32e6e5afe /becommands/help.py
parent84551c20fe603ee9832b0b17061660cdf31a913e (diff)
downloadbugseverywhere-7603adce0d52e387b8d0e14d881c1a7749a5f9e5.tar.gz
Completion support added to becommands/help
Diffstat (limited to 'becommands/help.py')
-rw-r--r--becommands/help.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/becommands/help.py b/becommands/help.py
index e228eed..7e0209d 100644
--- a/becommands/help.py
+++ b/becommands/help.py
@@ -33,7 +33,7 @@ def execute(args):
"""
parser = get_parser()
options, args = parser.parse_args(args)
- cmdutil.default_complete(options, args, parser)
+ complete(options, args, parser)
if len(args) > 1:
raise cmdutil.UsageError("Too many arguments.")
if len(args) == 0:
@@ -54,3 +54,12 @@ Print help for specified command or list of all commands.
def help():
return get_parser().help_str() + longhelp
+
+def complete(options, args, parser):
+ for option, value in cmdutil.option_value_pairs(options, parser):
+ if value == "--complete":
+ # no argument-options at the moment, so this is future-proofing
+ raise cmdutil.GetCompletions()
+ if "--complete" in args:
+ cmds = [command for command,module in cmdutil.iter_commands()]
+ raise cmdutil.GetCompletions(cmds)