diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-06-25 09:03:04 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-06-25 09:03:04 +0000 |
commit | a267832ddf4150652fde3936858841bb2edbd9ae (patch) | |
tree | 961f0cbcaf8dbdaf2ff2e1a5409d644158f592bf /Completion/Unix/Command | |
parent | dd54fb249881fa882319cd2642780dcebb8d9f7c (diff) | |
download | zsh-a267832ddf4150652fde3936858841bb2edbd9ae.tar.gz zsh-a267832ddf4150652fde3936858841bb2edbd9ae.tar.xz zsh-a267832ddf4150652fde3936858841bb2edbd9ae.zip |
18631: returning too early breaks prefix-needed style set to false
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r-- | Completion/Unix/Command/_ant | 10 | ||||
-rw-r--r-- | Completion/Unix/Command/_arp | 2 | ||||
-rw-r--r-- | Completion/Unix/Command/_bzip2 | 10 | ||||
-rw-r--r-- | Completion/Unix/Command/_compress | 14 | ||||
-rw-r--r-- | Completion/Unix/Command/_elinks | 4 | ||||
-rw-r--r-- | Completion/Unix/Command/_finger | 10 | ||||
-rw-r--r-- | Completion/Unix/Command/_gpg | 6 | ||||
-rw-r--r-- | Completion/Unix/Command/_gzip | 14 | ||||
-rw-r--r-- | Completion/Unix/Command/_java | 46 | ||||
-rw-r--r-- | Completion/Unix/Command/_links | 8 | ||||
-rw-r--r-- | Completion/Unix/Command/_look | 17 | ||||
-rw-r--r-- | Completion/Unix/Command/_lynx | 10 | ||||
-rw-r--r-- | Completion/Unix/Command/_lzop | 12 | ||||
-rw-r--r-- | Completion/Unix/Command/_mt | 8 | ||||
-rw-r--r-- | Completion/Unix/Command/_prcs | 8 | ||||
-rw-r--r-- | Completion/Unix/Command/_sccs | 9 | ||||
-rw-r--r-- | Completion/Unix/Command/_telnet | 12 | ||||
-rw-r--r-- | Completion/Unix/Command/_w3m | 23 | ||||
-rw-r--r-- | Completion/Unix/Command/_zip | 16 |
19 files changed, 128 insertions, 111 deletions
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant index ff973b37f..88c1f3ef4 100644 --- a/Completion/Unix/Command/_ant +++ b/Completion/Unix/Command/_ant @@ -1,7 +1,7 @@ #compdef ant -value-,ANT_ARGS,-default- typeset -A opt_args -local buildfile tmp state line curcontext="$curcontext" +local buildfile tmp state line curcontext="$curcontext" ret=1 local c target='*:target:->target' c=( $ANT_HOME/lib/*.jar ) @@ -30,7 +30,7 @@ _arguments -C \ '-propertyfile[load properties from specified file]:property file:_files' \ '-inputhandler[specify class which will handle input requests]:class:_java_class -cp ${(j.\:.)c}' \ '(-f -file -buildfile)-find[search for build file towards the root of filesystem]:build file:(build.xml)' \ - $target && return + $target && ret=0 case $state in property) @@ -78,7 +78,7 @@ case $state in esac done )//$'\015'}" - _describe 'target' tmp + _describe 'target' tmp && ret=0 else if [[ -n $opt_args[-find] ]]; then buildfile=( (../)#${opt_args[-find]:-build.xml}(N[-1]) ) @@ -87,10 +87,12 @@ case $state in fi if [[ -f $buildfile ]]; then targets=( $(sed -n 's/ *<target name="\([^"]*\)".*/\1/p' < $buildfile) ) - _wanted targets expl target compadd -a targets + _wanted targets expl target compadd -a targets && ret=0 else _message -e targets target fi fi ;; esac + +return ret diff --git a/Completion/Unix/Command/_arp b/Completion/Unix/Command/_arp index 9de19f67a..72b60fd2f 100644 --- a/Completion/Unix/Command/_arp +++ b/Completion/Unix/Command/_arp @@ -7,7 +7,7 @@ _arguments -C \ '(-a -s -f 1)-d[delete entry from table]:host:->hostintable' \ '(-a -d -f 1)-s[create an arp entry]:host:_hosts:ethernet address::*:option:(temp trail pub)' \ '(-a -d -s 1)-f[read multiple entries from file]:file:_files' \ - '(-a)1:host:->hostintable' && return 0 + '(-a)1:host:->hostintable' [[ "$state" = hostintable ]] && _wanted hosts expl 'host' compadd ${${${(f)"$(${words[1]} -a)"}##[ ?(]#}%%[ )]*} diff --git a/Completion/Unix/Command/_bzip2 b/Completion/Unix/Command/_bzip2 index cbce91ad6..15a78e578 100644 --- a/Completion/Unix/Command/_bzip2 +++ b/Completion/Unix/Command/_bzip2 @@ -1,6 +1,6 @@ #compdef bzip2 bunzip2 bzcat=bunzip2 bzip2recover -redirect-,<,bunzip2=bunzip2 -redirect-,>,bzip2=bunzip2 -redirect-,<,bzip2=bzip2 -local decompress expl state line curcontext="$curcontext" +local decompress expl state line curcontext="$curcontext" ret=1 typeset -A opt_args case "$service" in @@ -39,7 +39,7 @@ case "$service" in '(-1 -2 -3 -4 -5 -6 -8 -9)-7' \ '(-1 -2 -3 -4 -5 -6 -7 -9)-8' \ '(-1 -2 -3 -4 -5 -6 -7 -8 )-9' \ - '*:files:->files' && return 0 + '*:files:->files' && ret=0 ;; esac @@ -49,11 +49,11 @@ if [[ "$state" = files ]]; then $+opt_args[--test] )) && unset decompress if [[ -z "$decompress" ]]; then _description files expl 'compressed file' - _files "$expl[@]" -g '*.(bz2|tbz|tbz2)' && return 0 + _files "$expl[@]" -g '*.(bz2|tbz|tbz2)' && return else _description files expl 'file to compress' - _files "$expl[@]" -g '*~*.(bz2|tbz|tbz2)' && return 0 + _files "$expl[@]" -g '*~*.(bz2|tbz|tbz2)' && return fi fi -return 1 +return ret diff --git a/Completion/Unix/Command/_compress b/Completion/Unix/Command/_compress index a2e52704e..b8f691373 100644 --- a/Completion/Unix/Command/_compress +++ b/Completion/Unix/Command/_compress @@ -1,6 +1,6 @@ #compdef compress uncompress -redirect-,<,uncompress=uncompress -redirect-,>,compress=uncompress -redirect-,<,compress=compress -local expl state line bits common_args1 common_args2 decompress +local expl state line bits common_args1 common_args2 decompress ret=1 local curcontext="$curcontext" typeset -A opt_args bits=( {9..16} ) @@ -23,14 +23,14 @@ case "$service" in "-b[specify maximum number of bits used to replace common substring]:bits:(${bits[*]})" \ '-C[produce output compatible with BSD 2.0]' \ '(-b -C)-d[decompress]' \ - "${common_args2[@]}" && return 0 + "${common_args2[@]}" && ret=0 ;; uncompress) - _arguments -C -s "${common_args2[@]}" && return 0 + _arguments -C -s "${common_args2[@]}" && ret=0 decompress=yes ;; zcat) - _arguments -C -s "${common_args1[@]}" && return 0 + _arguments -C -s "${common_args1[@]}" && ret=0 decompress=yes ;; esac @@ -38,11 +38,11 @@ esac if [[ "$state" = files ]]; then if [[ -z "$decompress" ]] || (( $+opt_args[-d] )); then _description files expl 'file to compress' - _files "$expl[@]" -g '*~*.Z' && return 0 + _files "$expl[@]" -g '*~*.Z' && return else _description files expl 'compressed file' - _files "$expl[@]" -g '*.Z' && return 0 + _files "$expl[@]" -g '*.Z' && return fi fi -return 1 +return ret diff --git a/Completion/Unix/Command/_elinks b/Completion/Unix/Command/_elinks index 584a3cfe0..6e2832daf 100644 --- a/Completion/Unix/Command/_elinks +++ b/Completion/Unix/Command/_elinks @@ -25,7 +25,7 @@ _arguments -C -A '-*' \ '(1)*-stdin[read document from stdin]::boolean:(0 1)' \ '*-touch-files[touch files in ~/.elinks when running with -no-connect/-session-ring]::boolean:(0 1)' \ '(- 1)-version[print version information and exit]' \ - '1:url:->url' && return + '1:url:->url' && ret=0 if [[ "$state" = url ]]; then local elinks_bookmarks @@ -40,4 +40,4 @@ if [[ "$state" = url ]]; then 'urls:url:_urls' && return fi -return 1 +return ret diff --git a/Completion/Unix/Command/_finger b/Completion/Unix/Command/_finger index 4dd45f3c2..1ffb52d14 100644 --- a/Completion/Unix/Command/_finger +++ b/Completion/Unix/Command/_finger @@ -1,10 +1,10 @@ #compdef finger -local curcontext="$curcontext" state line match +local curcontext="$curcontext" state line match ret=1 typeset -A opt_args if (( ! $+_finger_args )); then - local help="$(_call_program options finger -\? 2>&1)" + local help="$(_call_program options finger -\\\? 2>&1)" local -A optionmap ## `finger -\?': @@ -69,10 +69,12 @@ if (( ! $+_finger_args )); then fi fi -_arguments -C -s $_finger_args '*:finger targets:->finger-targets' && return 0 +_arguments -C -s $_finger_args '*:finger targets:->finger-targets' && ret=0 case "$state" in finger-targets) - _user_at_host -t other-accounts "$@" + _user_at_host -t other-accounts "$@" && return ;; esac + +return ret diff --git a/Completion/Unix/Command/_gpg b/Completion/Unix/Command/_gpg index 76594d229..32a51cb08 100644 --- a/Completion/Unix/Command/_gpg +++ b/Completion/Unix/Command/_gpg @@ -1,6 +1,6 @@ #compdef gpg gpgv -local curcontext="$curcontext" state line expl +local curcontext="$curcontext" state line expl ret=1 typeset -A opt_args _arguments -C -s -S -A "-*" \ @@ -127,7 +127,7 @@ _arguments -C -s -S -A "-*" \ --enable-special-filenames --no-expensive-trust-checks --group:name=value \ --preserve-permissions --personal-{cipher,digest,compress}-preferences:string \ --default-preference-list:string \ - '*:args:->args' && return + '*:args:->args' && ret=0 if [[ $state = args ]]; then if (( ${+opt_args[--export]} || ${+opt_args[--list-keys]} )); then @@ -154,4 +154,4 @@ case "$state" in ;; esac -return 1 +return ret diff --git a/Completion/Unix/Command/_gzip b/Completion/Unix/Command/_gzip index 8c3c8c8c3..3f5aeb1b7 100644 --- a/Completion/Unix/Command/_gzip +++ b/Completion/Unix/Command/_gzip @@ -1,6 +1,6 @@ #compdef gzip gunzip gzcat=gunzip -redirect-,<,gunzip=gunzip -redirect-,>,gzip=gunzip -redirect-,<,gzip=gzip -value-,GZIP,-default- -local decompress files expl curcontext="$curcontext" state line +local decompress files expl curcontext="$curcontext" state line ret=1 typeset -A opt_args files=( '*:files:->files' ) @@ -58,7 +58,7 @@ gzip) '(--fast -1 -2 -3 -4 -5 -6 -7 -9 --best)-8' \ '(--fast -1 -2 -3 -4 -5 -6 -7 -8 --best)-9' \ '(--fast -1 -2 -3 -4 -5 -6 -7 -8 -9 )--best' \ - "$files[@]" && return 0 + "$files[@]" && ret=0 ;; esac @@ -71,19 +71,21 @@ files) if (( $+opt_args[-r] || $+opt_args[--recursive] )); then if [[ -z "$decompress" ]]; then _description directories expl 'directory to compress' - _files "$expl[@]" -/ + _files "$expl[@]" -/ && return else _description directories expl 'compressed directory' - _files "$expl[@]" -/ + _files "$expl[@]" -/ && return fi else if [[ -z "$decompress" ]]; then _description files expl 'file to compress' - _files "$expl[@]" -g '*~*.(([tT]|)[gG]|)[zZ]' + _files "$expl[@]" -g '*~*.(([tT]|)[gG]|)[zZ]' && return else _description files expl 'compressed file' - _files "$expl[@]" -g '*.(([tT]|)[gG]|)[zZ]' + _files "$expl[@]" -g '*.(([tT]|)[gG]|)[zZ]' && return fi fi ;; esac + +return ret diff --git a/Completion/Unix/Command/_java b/Completion/Unix/Command/_java index 992960f59..a9e620ab4 100644 --- a/Completion/Unix/Command/_java +++ b/Completion/Unix/Command/_java @@ -1,6 +1,6 @@ #compdef javac java javadoc appletviewer jar jdb javah javap extcheck rmic rmiregistry rmid serialvar native2ascii keytool jarsigner policytool -local expl tmp jdb_args jar_cmd match basedir +local expl tmp jdb_args jar_cmd match basedir ret=1 local curcontext="$curcontext" state line jf typeset -A opt_args tmpassoc @@ -89,7 +89,7 @@ javadoc) '-helpfile[specify alternative help link]:helpfile path/filename:' \ '-stylesheet[specify alternative HTML style sheet]:stylesheet path/filename:' \ '-docencoding[specify character encoding for output HTML files]:encoding:->encoding' \ - '*:package name, source file or @list:->docsrc' && return 0 + '*:package name, source file or @list:->docsrc' && ret=0 ;; appletviewer) @@ -112,7 +112,7 @@ jar) 'v[verbose mode]' \ 'm[specify manifest file]' \ '0[store only without using ZIP compression]' \ - 'M[do not create manifest file]' + 'M[do not create manifest file]' && return else jar_cmd="${words[2]#-}" tmpassoc=( @@ -186,7 +186,7 @@ rmic) rmiregistry) if (( CURRENT == 2 )); then - _wanted ports expl 'port to listen' _ports + _wanted ports expl 'port to listen' _ports && return else _message 'no more arguments' fi @@ -359,11 +359,11 @@ case "$state" in debug) if [[ -prefix :*, ]]; then compset -P : - _values -s , "debug info" lines vars source + _values -s , "debug info" lines vars source && return else _description debuginfo expl "debug info" - compadd -P: "$expl[@]" none - compadd -P: -qS, "$expl[@]" lines vars source + compadd -P: "$expl[@]" none && ret=0 + compadd -P: -qS, "$expl[@]" lines vars source && ret=0 fi ;; @@ -372,12 +372,12 @@ classpath|sourcepath|bootstrapclasspath|docletpath) compset -S ':*' _alternative \ "classpath:$state:_path_files -qS: -g '*.(jar|zip)'" \ - "classpath:$state:_path_files -r': ' -/" + "classpath:$state:_path_files -r': ' -/" && return ;; extdirs) compset -P '*:' - _path_files -/ + _path_files -/ && return ;; encoding) @@ -540,7 +540,7 @@ encoding) property) if compset -P '*='; then - _default + _default && return else _message -e property-names 'property name' fi @@ -548,30 +548,30 @@ property) docsrc) if compset -P @; then - _wanted files expl 'package/source list file' _files + _wanted files expl 'package/source list file' _files && return else - _wanted files expl 'package or source' _files -g '*.java' + _wanted files expl 'package or source' _files -g '*.java' && return fi ;; jararg) if [[ -prefix - ]]; then tmp=('-C:chdir') - _describe -o 'option' tmp -- + _describe -o 'option' tmp -- && return elif [[ "$words[CURRENT - 2]" == -C ]]; then - _wanted file expl 'input file' _files -W "($words[CURRENT - 1])" + _wanted file expl 'input file' _files -W "($words[CURRENT - 1])" && return elif [[ "$words[CURRENT - 1]" == -C ]]; then - _wanted directories expl 'chdir to' _files -/ + _wanted directories expl 'chdir to' _files -/ && return elif [[ $words[2] = *x* ]]; then - jf="$words[3]" - if [[ $jf != $_jar_cache_name && -f $jf ]]; then - _jar_cache_list=("${(@f)$($words[1] tf $jf)}") - _jar_cache_name=$jf - fi + jf="$words[3]" + if [[ $jf != $_jar_cache_name && -f $jf ]]; then + _jar_cache_list=("${(@f)$($words[1] tf $jf)}") + _jar_cache_name=$jf + fi - _wanted files expl 'file from archive' _multi_parts / _jar_cache_list + _wanted files expl 'file from archive' _multi_parts / _jar_cache_list && return else - _wanted files expl 'input file' _files + _wanted files expl 'input file' _files && return fi ;; @@ -579,3 +579,5 @@ jararg) _message "unknown state: $state" ;; esac + +return ret diff --git a/Completion/Unix/Command/_links b/Completion/Unix/Command/_links index adb0651f4..7d8a83a23 100644 --- a/Completion/Unix/Command/_links +++ b/Completion/Unix/Command/_links @@ -1,6 +1,6 @@ #compdef links -local curcontext="$curcontext" state line +local curcontext="$curcontext" state line ret=1 typeset -A opt_args _arguments -C \ @@ -25,8 +25,10 @@ _arguments -C \ '(-help)-source[dump the source page]' \ '(-help)-unrestartable-receive-timeout[timeout on non restartable connections]:secs:' \ '(-help)-version[prints the links version number and exit]' \ - ':url:->html' && return 0 + ':url:->html' && ret=0 if [[ "$state" = html ]]; then - _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_urls' + _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_urls' && ret=0 fi + +return ret diff --git a/Completion/Unix/Command/_look b/Completion/Unix/Command/_look index b80a70824..825488c37 100644 --- a/Completion/Unix/Command/_look +++ b/Completion/Unix/Command/_look @@ -1,6 +1,6 @@ #compdef look -local curcontext="$curcontext" state line +local curcontext="$curcontext" state line ret=1 typeset -A opt_args _arguments -C -s \ @@ -8,14 +8,9 @@ _arguments -C -s \ '-f[case insensitive]' \ '-d[dictionary order]' \ ':string:->string' \ - ':dictionary file:_files' && return 0 + ':dictionary file:_files' && ret=0 -case "$state" in -string) - if [[ -n "$PREFIX" ]]; then - _wanted values expl 'word prefix' compadd - $(_call_program values $words[1] $PREFIX) - else - _message -e prefixes 'word prefix' - fi - ;; -esac +[[ -n "$state" && ! -prefix - ]] && _wanted values expl 'word prefix' \ + compadd - $(_call_program words $words[1] '"$PREFIX"') && return + +return ret diff --git a/Completion/Unix/Command/_lynx b/Completion/Unix/Command/_lynx index 855213b7c..6bbe01449 100644 --- a/Completion/Unix/Command/_lynx +++ b/Completion/Unix/Command/_lynx @@ -1,6 +1,6 @@ #compdef lynx -local curcontext="$curcontext" state line +local curcontext="$curcontext" state line ret=1 typeset -A opt_args _arguments -C \ @@ -128,7 +128,7 @@ _arguments -C \ '-vikeys' \ '-width=:NUMBER:' \ '-with_backspaces' \ - ':url:->html' && return 0 + ':url:->html' && ret=0 case "$state" in restrictions) @@ -137,9 +137,11 @@ restrictions) disk_save dotfiles download editor exec exec_frozen externals file_url \ goto inside_ftp inside_news inside_rlogin inside_telnet jump mail \ multibook news_post options_save outside_ftp outside_news outside_rlogin \ - outside_telnet print shell suspend telnet_port useragent + outside_telnet print shell suspend telnet_port useragent && return ;; html) - _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_urls' + _alternative 'files:file:_files -g "*.x#html"' 'urls:url:_urls' && return ;; esac + +return ret diff --git a/Completion/Unix/Command/_lzop b/Completion/Unix/Command/_lzop index bb918fd30..bad9c14d4 100644 --- a/Completion/Unix/Command/_lzop +++ b/Completion/Unix/Command/_lzop @@ -1,6 +1,6 @@ #compdef lzop -local expl state line decompress disp curcontext="$curcontext" sep +local expl state line decompress disp curcontext="$curcontext" sep ret=1 typeset -A opt_args _arguments -C -s \ @@ -74,7 +74,7 @@ _arguments -C -s \ '--color[assume a color ANSI terminal]' \ '--intro[display intro sequence]' \ '--filter=[preprocess data with a special multimedia filter]:number' \ - '*:files:->files' && return 0 + '*:files:->files' && ret=0 case "$state" in files) @@ -83,10 +83,10 @@ case "$state" in $+opt_args[--test] || $+opt_args[-t] || $+opt_args[--list] || $+opt_args[-l] || $+opt_args[--ls] || $+opt_args[--info] )); then _description files expl 'compressed file' - _files "$expl[@]" -g '*.[tl]zo' + _files "$expl[@]" -g '*.[tl]zo' && ret=0 else _description files expl 'file to compress' - _files "$expl[@]" -g '*~*.[tl]zo' + _files "$expl[@]" -g '*~*.[tl]zo' && ret=0 fi ;; @@ -98,6 +98,8 @@ case "$state" in "Q $sep Enclose file names in double quotes" ) disp=( ${disp[@]:#[Z$PREFIX]*} ) compset -P '[FGQ]*' - compadd -d disp - ${disp[@]%% *} + compadd -d disp - ${disp[@]%% *} && ret=0 ;; esac + +return ret diff --git a/Completion/Unix/Command/_mt b/Completion/Unix/Command/_mt index 8296d1c8d..738c63abf 100644 --- a/Completion/Unix/Command/_mt +++ b/Completion/Unix/Command/_mt @@ -1,7 +1,7 @@ #compdef mt local -a args cmds -local state line curcontext="$curcontext" +local state line curcontext="$curcontext" ret=1 args=( '(-)-f[specify raw tape device]:tape device:_files' ) cmds=( @@ -73,6 +73,8 @@ elif [[ $OSTYPE = solaris* ]]; then fi _arguments -C "$args[@]" '(--help --version -V)1:operation:->operation' \ - '2:count:' && return + '2:count:' && ret=0 -[[ -n "$state" ]] && _describe -t operations 'operation' cmds +[[ -n "$state" ]] && _describe -t operations 'operation' cmds && ret=0 + +return ret diff --git a/Completion/Unix/Command/_prcs b/Completion/Unix/Command/_prcs index 29a1c8652..46e441c34 100644 --- a/Completion/Unix/Command/_prcs +++ b/Completion/Unix/Command/_prcs @@ -1,6 +1,6 @@ #compdef prcs -local curcontext="$curcontext" state line subcmds +local curcontext="$curcontext" state line subcmds ret=1 typeset -A opt_args # lookup project names in the repository @@ -34,7 +34,7 @@ _prcs_arguments() { _arguments -C \ '(* -)'{-h,-H,--help}'[print out help]' \ '(* -)--version[display program version]' \ - '*:: :->subcmd' && return 0 + '*:: :->subcmd' && ret=0 if (( CURRENT == 1 )); then subcmds=( @@ -54,8 +54,8 @@ if (( CURRENT == 1 )); then 'unpackage:unpackage project in packagefile' ) - _describe -t commands 'prcs command' subcmds - return + _describe -t commands 'prcs command' subcmds && ret=0 + return ret fi curcontext="${curcontext%:*}-$words[1]:" diff --git a/Completion/Unix/Command/_sccs b/Completion/Unix/Command/_sccs index b3b6f49e9..40463b2f1 100644 --- a/Completion/Unix/Command/_sccs +++ b/Completion/Unix/Command/_sccs @@ -15,7 +15,7 @@ _sccs_files() { return ret } -local curcontext="$curcontext" state line +local curcontext="$curcontext" state line ret=1 typeset -A opt_args local subcmds ropt copt sfiles finalpath @@ -56,12 +56,13 @@ if [[ $service = sccs ]]; then '-r[run with real and not effective user ID]' \ '-d+[specify root prefix]:root prefix:_directories' \ '-p+[specify subdirectory of history file]:path to history file:_directories' \ - '*::command:->subcmd' && return 0 + '*::command:->subcmd' && ret=0 if (( CURRENT == 1 )); then - _describe -t commands 'sccs command' subcmds - return + _describe -t commands 'sccs command' subcmds && ret=0 fi + (( ret )) || return 0 + service="$words[1]" sfiles=':file:_sccs_files' curcontext="${curcontext%:*}-$service:" diff --git a/Completion/Unix/Command/_telnet b/Completion/Unix/Command/_telnet index 4ff6ed2a7..bab9c8d36 100644 --- a/Completion/Unix/Command/_telnet +++ b/Completion/Unix/Command/_telnet @@ -5,7 +5,7 @@ # telnet_hosts_ports_users # The array that contains 3-tuples `host:port:user'. -local curcontext="$curcontext" state line expl +local curcontext="$curcontext" state line expl ret=1 typeset -A opt_args if (( ! $+_telnet_args )); then @@ -43,14 +43,14 @@ fi _arguments -C -s \ "$_telnet_args[@]" \ ':host:->hosts' \ - ':port:->ports' && return 0 + ':port:->ports' && ret=0 case "$state" in hosts) _wanted hosts expl host \ _combination -s '[@:]' '' users-hosts-ports \ ${opt_args[-l]:+users=${opt_args[-l]:q}} \ - hosts - + hosts - && ret=0 ;; ports) @@ -58,7 +58,7 @@ ports) _combination -s '[@:]' '' users-hosts-ports \ ${opt_args[-l]:+users=${opt_args[-l]:q}} \ hosts="${line[1]:q}" \ - ports - + ports - && ret=0 ;; users) @@ -66,6 +66,8 @@ users) _combination -s '[@:]' '' users-hosts-ports \ ${line[2]:+hosts="${line[2]:q}"} \ ${line[3]:+ports="${line[3]:q}"} \ - users - + users - && ret=0 ;; esac + +return ret diff --git a/Completion/Unix/Command/_w3m b/Completion/Unix/Command/_w3m index 4ce8ad1e0..70ac75e4c 100644 --- a/Completion/Unix/Command/_w3m +++ b/Completion/Unix/Command/_w3m @@ -1,6 +1,6 @@ #compdef w3m -local curcontext="$curcontext" state line +local curcontext="$curcontext" state line ret=1 typeset -A opt_args _arguments -C \ @@ -31,18 +31,19 @@ _arguments -C \ '-o[option]:option-value:' \ '-config:config file:_files' \ '-debug' \ - ':url:->url' && return 0 + ':url:->url' && ret=0 case $state in - url) - local _w3mhistory + url) + local _w3mhistory - if [[ -s ~/.w3m/history ]]; then - _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"}) - compadd $_w3mhistory - fi - - _urls -f - ;; + if [[ -s ~/.w3m/history ]]; then + _w3mhistory=(${(f)"$(<$HOME/.w3m/history)"}) + compadd $_w3mhistory && ret=0 + fi + _urls -f && ret=0 + ;; esac + +return ret 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 |