author | Dmitriy Morozov <dmitriy@mrzv.org> |
Sat, 06 Nov 2010 12:14:40 -0700 | |
changeset 132 | b072cb473b47 |
parent 122 | 76334dcc9ae4 (diff) |
parent 131 | 7064f9073401 (current diff) |
child 144 | c66e1ada4c08 |
opster.py | file | annotate | diff | comparison | revisions | |
tests/runtests | file | annotate | diff | comparison | revisions | |
tests/test | file | annotate | diff | comparison | revisions | |
tests/test.out | file | annotate | diff | comparison | revisions | |
tests/test.py | file | annotate | diff | comparison | revisions | |
tests/test2 | file | annotate | diff | comparison | revisions | |
tests/test_cmd | file | annotate | diff | comparison | revisions | |
tests/test_cmd.out | file | annotate | diff | comparison | revisions | |
tests/test_cmd.py | file | annotate | diff | comparison | revisions | |
tests/test_opts | file | annotate | diff | comparison | revisions | |
tests/test_opts.err | file | annotate | diff | comparison | revisions | |
tests/test_opts.out | file | annotate | diff | comparison | revisions |
--- a/opster.py Tue Nov 02 13:38:19 2010 +0100 +++ b/opster.py Sat Nov 06 12:14:40 2010 -0700 @@ -543,10 +543,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] @@ -571,6 +575,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