From 8e989347bdefab6a77e32072265fa0bd8c143c43 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 27 Nov 2008 09:34:54 -0500 Subject: Merged --commands and --options into --complete. Simpler that way. --- be | 5 ++--- becommands/list.py | 4 ++-- completion/be.bash | 12 ++++-------- libbe/cmdutil.py | 20 ++++++++------------ 4 files changed, 16 insertions(+), 25 deletions(-) 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 [