summaryrefslogtreecommitdiffstats
path: root/completion.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-03-14 22:55:20 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-03-14 22:55:20 +0100
commit8f5cf7bfb85b7746b5e855e4027ba2dfbb006cfc (patch)
tree2e95bff47c77b0163349a6b4541eab04762389d0 /completion.py
parentd03638cff10636995c5c29a4120f031fbc77fc6c (diff)
downloadclufter-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.py4
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