summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_mpc
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2014-10-14 23:03:40 +0200
committerOliver Kiddle <opk@zsh.org>2014-10-14 23:04:45 +0200
commit13fc579343b24d298fb8905933b6000d7fcda114 (patch)
treecbc1000696357438714107635f93166bcab76d3a /Completion/Unix/Command/_mpc
parent66320ca93a717467a0ed0d34da4c06257953aa50 (diff)
downloadzsh-13fc579343b24d298fb8905933b6000d7fcda114.tar.gz
zsh-13fc579343b24d298fb8905933b6000d7fcda114.zip
33467: correct return status on functions and numerous other minor fixes
Diffstat (limited to 'Completion/Unix/Command/_mpc')
-rw-r--r--Completion/Unix/Command/_mpc18
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]}")