summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_iconv
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-03-12 18:55:12 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-03-12 18:55:12 +0000
commit01e67ec323e5466204970a637f81e4d4427da396 (patch)
treee584bb6e3b8b8473fda4b783fe9745901e0ec44a /Completion/Unix/Command/_iconv
parent9ba4f4af9c73f296d32a64c7458542f02f701c41 (diff)
downloadzsh-01e67ec323e5466204970a637f81e4d4427da396.tar.gz
zsh-01e67ec323e5466204970a637f81e4d4427da396.zip
fix completions of locales on Linux, complete for more commands using
existing completions and more improvements to sccs completion
Diffstat (limited to 'Completion/Unix/Command/_iconv')
-rw-r--r--Completion/Unix/Command/_iconv33
1 files changed, 21 insertions, 12 deletions
diff --git a/Completion/Unix/Command/_iconv b/Completion/Unix/Command/_iconv
index 490d70bc8..8e12e2107 100644
--- a/Completion/Unix/Command/_iconv
+++ b/Completion/Unix/Command/_iconv
@@ -1,24 +1,33 @@
#compdef iconv
-local expl curcontext="$curcontext" state line codeset LOCPATH
+local expl curcontext="$curcontext" state line codeset LOCPATH ret=1
if _pick_variant gnu=GNU unix --version; then
- _arguments -C \
- {'(--from-code --list)-f','(-f --list)--from-code='}'[specify code set of input file]:code set:->codeset' \
- {'(--to-code --list)-t','(-t --list)--to-code='}'[specify code set for output]:code set:->codeset' \
- '--list[list all character code sets]' \
- '--verbose[print progress information]' \
- {'(--help)-\?','(-\?)--help'}'[display help information]' \
- '--usage[display a short usage message]' \
- {'(--version)-V','(-V)--version'}'[print program version]' \
- '1:file:_files' && return 0
+ local exargs="--list -? --help --usage --version -V"
+ _arguments -C -S -s \
+ "(-f --from-code $exargs)"{-f+,--from-code=}'[specify code set of input file]:code set:->codeset' \
+ "(-t --to-code $exargs)"{-t+,--to-code=}'[specify code set for output]:code set:->codeset' \
+ '(- 1)--list[list all character code sets]' \
+ "($exargs)-c[omit invalid characters from output]" \
+ "(-o --output $exargs)"{-o+,--output=}'[specify output file]:output file:_files' \
+ "(-s --silent --verbose $exargs)"{-s,--silent}'[suppress warnings]' \
+ "(-s --silent $exargs)--verbose[print progress information]" \
+ '(-)'{-\?,--help}'[display help information]' \
+ '(-)--usage[display a short usage message]' \
+ '(-)'{-V,--version}'[print program version]' \
+ '1:input file:_files' && return 0
if [[ $state = codeset ]]; then
- _wanted codesets expl 'code set' \
- compadd "$@" ${${(s:,:)$(iconv --list|sed -n '/^$/,$ p')}## #}
+ if compset -P '*/'; then
+ _wanted option expl option compadd "$@" /TRANSLIT && ret=0
+ else
+ _wanted codesets expl 'code set' compadd "$@" -M 'r:|-=* r:|=*' \
+ ${${${(f)"$(iconv --list|sed -n '/^$/,$ p')"}## #}%//} && ret=0
+ fi
fi
+ return ret
else
_arguments -C \