From: W. Trevor King Date: Thu, 27 Nov 2008 14:34:54 +0000 (-0500) Subject: Merged --commands and --options into --complete. Simpler that way. X-Git-Tag: 1.0.0~101 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8e989347bdefab6a77e32072265fa0bd8c143c43;p=be.git Merged --commands and --options into --complete. Simpler that way. --- diff --git a/be b/be index ab6ddeb..35dab69 100755 --- a/be +++ b/be @@ -24,11 +24,10 @@ __doc__ == cmdutil.help() if len(sys.argv) == 1 or sys.argv[1] in ('--help', '-h'): print cmdutil.help() -elif sys.argv[1] == '--commands': +elif sys.argv[1] == '--complete': for command, module in cmdutil.iter_commands(): print command -elif sys.argv[1] == '--options': - print '\n'.join(cmdutil.options()) + print '\n'.join(["--help","--complete","--options"]) else: try: try: diff --git a/becommands/list.py b/becommands/list.py index 7c51f11..25e72d3 100644 --- a/becommands/list.py +++ b/becommands/list.py @@ -37,11 +37,11 @@ def execute(args, test=False): for option in [o.dest for o in parser.option_list if o.dest != None]: value = getattr(options, option) - if value == "--options": + if value == "--complete": if option == "status": raise cmdutil.GetCompletions(status_values) raise cmdutil.GetCompletions() - if "--options" in args: + if "--complete" in args: raise cmdutil.GetCompletions() # no completions for arguments yet if len(args) > 0: diff --git a/completion/be.bash b/completion/be.bash index 8789352..dbe1214 100644 --- a/completion/be.bash +++ b/completion/be.bash @@ -11,13 +11,9 @@ # "An introduction to bash completion: part 2" # http://www.debian-administration.org/articles/317 -# Support commands of the form: -# be [] [] ... # Requires: -# be --commands -# to print a list of available commands -# be command [