Merged upstream
authorDmitriy Morozov <dmitriy@mrzv.org>
Thu, 24 Feb 2011 22:58:28 -0800
changeset 182 f8a82de0540d
parent 144 c66e1ada4c08 (diff)
parent 181 c3cb22c01987 (current diff)
child 189 a46bf1c7f346
Merged upstream
docs/_static/custom.css
opster.py
--- a/opster.py	Thu Feb 17 22:25:22 2011 +0100
+++ b/opster.py	Thu Feb 24 22:58:28 2011 -0800
@@ -626,10 +626,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]
@@ -654,6 +658,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