summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_zip
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-06-25 09:03:04 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-06-25 09:03:04 +0000
commita267832ddf4150652fde3936858841bb2edbd9ae (patch)
tree961f0cbcaf8dbdaf2ff2e1a5409d644158f592bf /Completion/Unix/Command/_zip
parentdd54fb249881fa882319cd2642780dcebb8d9f7c (diff)
downloadzsh-a267832ddf4150652fde3936858841bb2edbd9ae.tar.gz
zsh-a267832ddf4150652fde3936858841bb2edbd9ae.zip
18631: returning too early breaks prefix-needed style set to false
Diffstat (limited to 'Completion/Unix/Command/_zip')
-rw-r--r--Completion/Unix/Command/_zip16
1 files changed, 9 insertions, 7 deletions
diff --git a/Completion/Unix/Command/_zip b/Completion/Unix/Command/_zip
index 29c4f85d4..479b05aba 100644
--- a/Completion/Unix/Command/_zip
+++ b/Completion/Unix/Command/_zip
@@ -1,7 +1,7 @@
#compdef zip unzip zipinfo
local suffixes suf zipfile uzi
-local expl curcontext="$curcontext" state line
+local expl curcontext="$curcontext" state line ret=1
typeset -A opt_args
case $service in
@@ -51,7 +51,7 @@ case $service in
'-x[exclude the following names]' \
'-i[include only the following names]' \
"(-f -d -R -q -c -b -@ -F -FF -A -T -y -e -h -u -m -g -j -l -ll -L -v -z -t -tt -o -D -J -X -n -0 -1 -2 -3 -4 -5 -6 -7 -8 -9):zip file:_files -g '(#i)*.(zip|[ejw]ar)'" \
- '*:file:->files' && return 0
+ '*:file:->files' && ret=0
;;
unzip)
_arguments -C -s \
@@ -76,7 +76,7 @@ case $service in
'-x[exclude the following names]' \
'-Z[zipinfo mode]:zipinfomode:->zipinfo' \
"(-p -f -u -l -t -z -n -o -j -C -X -q -qq -a -aa -v -L -M)1:zip file:_files -g '(#i)*.(zip|[ejw]ar)'" \
- '*:file:->files' && return 0
+ '*:file:->files' && ret=0
;;
esac
@@ -99,7 +99,7 @@ if [[ $service == zipinfo ]] || [[ -n $uzi ]]; then
'-M[page output]' \
'-x[exclude the following names]' \
"(-1 -2 -s -m -l -v -h -z -C -t -T -M)1:zip file:_files -g '(#i)*.(zip|[ejw]ar)'" \
- '*:file:->files' && return 0
+ '*:file:->files' && ret=0
fi
case $state in
@@ -108,11 +108,11 @@ case $state in
compset -S ':*' || suf=":."
suffixes=( *.*(N:e) )
_wanted suffixes expl suffixes \
- compadd -S "$suf" -r ": \t" .$^suffixes && return 0
+ compadd -S "$suf" -r ": \t" .$^suffixes && return
;;
files)
if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then
- _files -g '^(#i)*.(zip|[ejw]ar)' && return 0
+ _wanted files expl zfile _files -g '^(#i)*.(zip|[ejw]ar)' && return
else
zipfile=( $~line[1](|.zip|.ZIP) )
[[ -z $zipfile[1] ]] && return 1
@@ -121,7 +121,9 @@ case $state in
_zip_cache_list=( ${(f)"$(zipinfo -1 $_zip_cache_name)"} )
fi
_wanted files expl 'file from archive' \
- _multi_parts / _zip_cache_list && return 0
+ _multi_parts / _zip_cache_list && return
fi
;;
esac
+
+return ret