Merged upstream default tip
authorDmitriy Morozov <dmitriy@mrzv.org>
Mon, 04 Apr 2011 12:56:15 -0700
changeset 189 a46bf1c7f346
parent 182 f8a82de0540d (diff)
parent 188 8ee4c9ad1325 (current diff)
Merged upstream
opster.py
--- a/opster.py	Tue Mar 29 10:34:58 2011 +0200
+++ b/opster.py	Mon Apr 04 12:56:15 2011 -0700
@@ -622,10 +622,14 @@
         print ' '.join(filter(lambda x: x.startswith(current), commands))
 
     # command options
-    elif cwords[0] in commands:
+    else:
+        try:
+            aliases, (cmd, opts, usage) = findcmd(cwords[0], cmdtable)
+        except AmbiguousCommand:
+            sys.exit(1) 
+
         idx = -2 if current else -1
         options = []
-        aliases, (cmd, opts, usage) = findcmd(cwords[0], cmdtable)
 
         for o in opts:
             short, long, default, help = o[:4]
@@ -650,6 +654,7 @@
     COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
                    COMP_CWORD=$COMP_CWORD \\
                    OPSTER_AUTO_COMPLETE=1 $1 ) )
+    COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
 }
 complete -o default -F _opster_completion %s
 # opster bash completion end