Merged upstream
authorDmitriy Morozov <dmitriy@mrzv.org>
Fri, 03 Dec 2010 11:53:57 -0800
changeset 144 c66e1ada4c08
parent 132 b072cb473b47 (diff)
parent 143 2327cc333e50 (current diff)
child 182 f8a82de0540d
Merged upstream
opster.py
--- a/opster.py	Sat Nov 27 20:48:16 2010 +0100
+++ b/opster.py	Fri Dec 03 11:53:57 2010 -0800
@@ -562,10 +562,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]
@@ -590,6 +594,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