diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-05-05 23:32:59 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-05-05 23:58:59 +0200 |
commit | db38e167634b6c2217eec3a5aafc37c46d9e5a8d (patch) | |
tree | daa342d423febbd3a5a7ef97053037677fab004a /Completion/Unix/Command/_mpc | |
parent | 01eea47617a6e06debdb4330f92ae69f92089fd2 (diff) | |
parent | 3c3c8d3d13fd4cf6c03f81ca8dc18a1efd561728 (diff) | |
download | zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.tar.gz zsh-db38e167634b6c2217eec3a5aafc37c46d9e5a8d.zip |
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_mpc')
-rw-r--r-- | Completion/Unix/Command/_mpc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Completion/Unix/Command/_mpc b/Completion/Unix/Command/_mpc index 12707677f..11eab8463 100644 --- a/Completion/Unix/Command/_mpc +++ b/Completion/Unix/Command/_mpc @@ -68,21 +68,21 @@ _mpc_command() { ) if (( CURRENT == 1 )); then - _describe -t command "mpc commands" mpc_cmds + _describe -t commands "mpc command" mpc_cmds else - local curcontext="$curcontext" + local cmd=$words[1] + local curcontext="${curcontext%:*}:mpc-${cmd}" ret=1 + if ! _call_function ret _mpc_$cmd; then + _default && ret=0 + fi + return ret fi - - local cmd=$words[1] - - local curcontext="${curcontext%:*}:mpc-${cmd}" - _call_function ret _mpc_$cmd } _mpc_helper_bool() { local expl states states=(on off yes no 1 0 true false) - _wanted states expl boolean compadd $expl -a states + _wanted states expl boolean compadd -a states } (( $+functions[_mpc_helper_songnumbers] )) || @@ -100,7 +100,7 @@ _mpc_helper_songnumbers() { NM="$compstate[nmatches]" fi - out=("${(@f)$(_call_program song-numbers mpc $foo playlist 2>/dev/null)}") + out=("${(@f)$(_call_program song-numbers mpc $foo playlist)}") out=("${(@M)out[@]:#${~MATCH}}") sn=("${(@)${(@M)out}//(#b)(#s)(\#|[ >]#)([0-9]#)*/$match[2]}") |