diff options
author | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-05 13:38:45 +0000 |
---|---|---|
committer | Sven Wischnowsky <wischnow@users.sourceforge.net> | 2000-05-05 13:38:45 +0000 |
commit | 9f9b6e165516c4ee59b1f5b609a6890ccc3d598f (patch) | |
tree | 86460ad1a9886e6030fc1b1d1aee57668f28aa01 /Completion/User/_compress | |
parent | 04118530d4157d3494349e2628246b78465e08f8 (diff) | |
download | zsh-9f9b6e165516c4ee59b1f5b609a6890ccc3d598f.tar.gz zsh-9f9b6e165516c4ee59b1f5b609a6890ccc3d598f.tar.xz zsh-9f9b6e165516c4ee59b1f5b609a6890ccc3d598f.zip |
completion function cleanup for `_arguments' with the `-C' option and using it's return value (11195)
Diffstat (limited to 'Completion/User/_compress')
-rw-r--r-- | Completion/User/_compress | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Completion/User/_compress b/Completion/User/_compress index 288bb1645..3521dfef6 100644 --- a/Completion/User/_compress +++ b/Completion/User/_compress @@ -1,6 +1,7 @@ #compdef compress uncompress local expl state line bits common_args1 common_args2 decompress +local curcontext="$curcontext" typeset -A opt_args bits=( {9..16} ) @@ -18,18 +19,18 @@ common_args2=( \ case "${words[1]:t}" in compress) - _arguments -s \ + _arguments -C -s \ "-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[@]}" + "${common_args2[@]}" && return 0 ;; uncompress) - _arguments -s "${common_args2[@]}" + _arguments -C -s "${common_args2[@]}" && return 0 decompress=yes ;; zcat) - _arguments -s "${common_args1[@]}" + _arguments -C -s "${common_args1[@]}" && return 0 decompress=yes ;; esac @@ -37,9 +38,11 @@ esac if [[ "$state" = files ]]; then if [[ -z "$decompress" ]] || (( $+opt_args[-d] )); then _description files expl 'file to compress' - _files "$expl[@]" -g '*~*.Z' + _files "$expl[@]" -g '*~*.Z' && return 0 else _description files expl 'compressed file' - _files "$expl[@]" -g '*.Z' + _files "$expl[@]" -g '*.Z' && return 0 fi fi + +return 1 |