diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-03-14 22:55:20 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-03-14 22:55:20 +0100 |
commit | 8f5cf7bfb85b7746b5e855e4027ba2dfbb006cfc (patch) | |
tree | 2e95bff47c77b0163349a6b4541eab04762389d0 /completion.py | |
parent | d03638cff10636995c5c29a4120f031fbc77fc6c (diff) | |
download | clufter-8f5cf7bfb85b7746b5e855e4027ba2dfbb006cfc.tar.gz clufter-8f5cf7bfb85b7746b5e855e4027ba2dfbb006cfc.tar.xz clufter-8f5cf7bfb85b7746b5e855e4027ba2dfbb006cfc.zip |
completion: allow for fruitful subcommand-less fallback
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'completion.py')
-rw-r--r-- | completion.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/completion.py b/completion.py index 5a39aba..d5336f4 100644 --- a/completion.py +++ b/completion.py @@ -122,7 +122,9 @@ while true; do {5} esac fnc=_{0}_${{cur/-/_}} - declare -f ${{fnc}} >/dev/null && COMPREPLY+=( $(${{fnc}} $2) ) + declare -f ${{fnc}} >/dev/null \ + && COMPREPLY+=( $(${{fnc}} $2) ) \ + || continue [[ "$2" =~ ^-.* ]] \ && COMPREPLY+=( $(compgen -W "${{opts_common}} ${{opts_nonmain}}" -- $2) ) return |