about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2005-03-21 16:50:17 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2005-03-21 16:50:17 +0000
commite222689ea14bcf037ef5085d85216c8bd2ddd3d0 (patch)
treeb21e27027f452fae2c5a2edd54ef178e480d422f /Completion
parent9e942b364aa50cc3a64baab2de39ad030dde2c22 (diff)
downloadzsh-e222689ea14bcf037ef5085d85216c8bd2ddd3d0.tar.gz
zsh-e222689ea14bcf037ef5085d85216c8bd2ddd3d0.tar.xz
zsh-e222689ea14bcf037ef5085d85216c8bd2ddd3d0.zip
merge changes from 4.3 branch
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/Completer/_expand226
-rw-r--r--Completion/Linux/Command/_valgrind96
-rw-r--r--Completion/Unix/Command/.distfiles31
-rw-r--r--Completion/Unix/Command/_ant102
-rw-r--r--Completion/Unix/Command/_iconv55
-rw-r--r--Completion/Unix/Command/_unace18
6 files changed, 528 insertions, 0 deletions
diff --git a/Completion/Base/Completer/_expand b/Completion/Base/Completer/_expand
new file mode 100644
index 000000000..4bb9ab777
--- /dev/null
+++ b/Completion/Base/Completer/_expand
@@ -0,0 +1,226 @@
+#autoload
+
+# This completer function is intended to be used as the first completer
+# function and allows one to say more explicitly when and how the word
+# from the line should be expanded than expand-or-complete.
+# This function will allow other completer functions to be called if
+# the expansions done produce no result or do not change the original
+# word from the line.
+
+setopt localoptions nonomatch
+
+[[ _matcher_num -gt 1 ]] && return 1
+
+local exp word sort expr expl subd suf=" " force opt asp tmp opre pre epre
+local continue=0
+
+(( $# )) &&
+    while getopts gsco opt; do
+      force="$force$opt"
+    done
+
+if [[ "$funcstack[2]" = _prefix ]]; then
+  word="$IPREFIX$PREFIX$SUFFIX"
+else
+  word="$IPREFIX$PREFIX$SUFFIX$ISUFFIX"
+fi
+
+[[ "$word" = *\$(|\{[^\}]#) ||
+   ( "$word" = *\$[a-zA-Z0-9_]## && $+parameters[${word##*\$}] -eq 0 ) ]] &&
+    return 1
+
+### I'm not sure about the pattern to use in the following test.
+# It once was:
+#  [[ "$word" = (\~*/|\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|\$\{*\}?)[^\$\{\}\(\)\<\>?^*#~]# ]] &&
+
+zstyle -T ":completion:${curcontext}:" suffix &&
+  [[ "$word" = (\~*/*|*\$(|[=~#^+])[a-zA-Z0-9_\[\]]##[^a-zA-Z0-9_\[\]]|*\$\{*\}?) &&
+     "${(e)word}" != (#s)(*[^\\]|)[][^*?\(\)\<\>\{\}\|]* ]] &&
+  return 1
+
+zstyle -s ":completion:${curcontext}:" accept-exact tmp ||
+    [[ ! -o recexact ]] || tmp=1
+
+if [[ "$tmp" != (yes|true|on|1) ]]; then
+  { [[ "$word" = \~(|[-+]) ||
+       ( "$word" = \~[-+][1-9]## && $word[3,-1] -le $#dirstack ) ]] && return 1 }
+  { [[ ( "$word" = \~* && ${#userdirs[(I)${word[2,-1]}*]}+${#nameddirs[(I)${word[2,-1]}*]} -gt 1 ) ||
+       ( "$word" = *\$[a-zA-Z0-9_]## && 
+         ${#parameters[(I)${word##*\$}*]} -ne 1 ) ]] && continue=1 }
+  [[ continue -eq 1 && "$tmp" != continue ]] && return 1
+fi
+
+# In exp we will collect the expansions.
+
+exp=("$word")
+
+# First try substitution. That weird thing spanning multiple lines
+# changes quoted spaces, tabs, and newlines into spaces and protects
+# this function from aborting on parse errors in the expansion.
+
+if [[ "$force" = *s* ]] ||
+   zstyle -T ":completion:${curcontext}:" substitute; then
+
+###  We once used this:
+###
+###  [[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]] &&
+###      eval exp\=\( ${${(q)exp}:gs/\\{/\{/:gs/\\}/\}/} \) 2>/dev/null
+###
+###  instead of the following loop to expand braces.  But that made
+###  parameter expressions such as ${foo} be expanded like brace
+###  expansions, too (and with braceccl set...).
+
+   if [[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]]; then
+     local otmp
+
+     tmp=${(q)word}
+     while [[ $#tmp != $#otmp ]]; do
+       otmp=$tmp
+       tmp=${tmp//(#b)\\\$\\\{(([^\{\}]|\\\\{|\\\\})#)([^\\])\\\}/\\$\\\\{${match[1]}${match[3]}\\\\}}
+     done
+     eval exp\=\( ${tmp:gs/\\{/\{/:gs/\\}/\}/} \) 2>/dev/null
+   fi
+
+###  There's a bug: spaces resulting from brace expansion are quoted in
+###  the following expression, too.  We don't want that, but I have no
+###  idea how to fix it.
+
+  eval 'exp=( ${${(e)exp//\\[ 	
+]/ }//(#b)([ 	
+])/\\$match[1]} )' 2>/dev/null
+else
+  exp=( ${exp:s/\\\$/\$} )
+fi
+
+# If the array is empty, store the original string again.
+
+[[ -z "$exp" ]] && exp=("$word")
+
+subd=("$exp[@]")
+
+# Now try globbing.
+
+[[ "$force" = *g* ]] || zstyle -T ":completion:${curcontext}:" glob &&
+    eval 'exp=( ${~exp//(#b)\\[ 	
+]/$match[1]} ); exp=( ${(q)exp} )' 2>/dev/null
+
+### Don't remember why we once used this instead of the (q) above.
+#    eval 'exp=( ${~exp} ); exp=( ${exp//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} )' 2>/dev/null
+
+# If we don't have any expansions or only one and that is the same
+# as the original string, we let other completers run.
+
+(( $#exp )) || exp=("$subd[@]")
+
+[[ $#exp -eq 1 && "${exp[1]//\\}" = "${word//\\}"(|\(N\)) ]] && return 1
+
+# With subst-globs-only we bail out if there were no glob expansions,
+# regardless of any substitutions
+
+{ [[ "$force" = *o* ]] ||
+  zstyle -t ":completion:${curcontext}:" subst-globs-only } &&
+  [[ "$subd" = "$exp"(|\(N\)) ]] &&  return 1
+
+zstyle -s ":completion:${curcontext}:" keep-prefix tmp || tmp=changed
+
+if [[ "$word" = (\~*/*|*\$*/*) && "$tmp" = (yes|true|on|1|changed) ]]; then
+  if [[ "$word" = *\$* ]]; then
+    opre="${(M)word##*\$[^/]##/}"
+  else
+    opre="${word%%/*}"
+  fi
+  eval 'epre=( ${(e)~opre} )' 2> /dev/null
+
+  if [[ -n "$epre" && $#epre -eq 1 ]]; then
+    pre="${(q)epre[1]}"
+    [[ ( "$tmp" != changed || $#exp -gt 1 ||
+       "${opre}${exp[1]#${pre}}" != "$word" ) && "${exp[1]}" = $pre* ]] &&
+       exp=( ${opre}${^exp#${pre}} )
+  fi
+  [[ $#exp -eq 1 && "$exp[1]" = "$word" ]] && return 1
+fi
+
+# Now add as matches whatever the user requested.
+
+zstyle -s ":completion:${curcontext}:" sort sort
+
+[[ "$sort" = (yes|true|1|on) ]] && exp=( "${(@o)exp}" )
+
+if zstyle -s ":completion:${curcontext}:" add-space tmp; then
+  if [[ "$tmp" != *subst* || "$word" != *\$* || "$exp[1]" = *\$* ]]; then
+    [[ "$tmp" = *file* ]] && asp=file
+    [[ "$tmp" = *(yes|true|1|on|subst)* ]] && asp="yes$asp"
+  fi
+else
+  asp=file
+fi
+
+# If there is only one expansion, add a suitable suffix
+
+if (( $#exp == 1 )); then
+  if [[ -d ${exp[1]/${opre}/${pre}} && "$exp[1]" != */ ]]; then
+    suf=/
+  elif [[ "$asp" = yes* ||
+          ( "$asp" = *file && -f "${exp[1]/${opre}/${pre}}" ) ]]; then
+    suf=' '
+  else
+    suf=
+  fi
+fi
+
+if [[ -z "$compstate[insert]" ]] ;then
+  if [[ "$sort" = menu ]]; then
+    _description expansions expl expansions "o:$word"
+  else
+    _description -V expansions expl expansions "o:$word"
+  fi
+
+  compadd "$expl[@]" -UQ -qS "$suf" -a exp
+else
+  _tags all-expansions expansions original
+
+  if [[ $#exp -gt 1 ]] && _requested expansions; then
+    local i j normal space dir
+
+    if [[ "$sort" = menu ]]; then
+      _description expansions expl expansions "o:$word"
+    else
+      _description -V expansions expl expansions "o:$word"
+    fi
+    normal=()
+    space=()
+    dir=()
+
+    for i in "$exp[@]"; do
+      j="${i/${opre}/${pre}}"
+      if [[ -d "$j" && "$i" != */ ]]; then
+        dir=( "$dir[@]" "$i" )
+      elif [[ "$asp" = yes* || ( "$asp" = *file && -f "$j" ) ]]; then
+        space=( "$space[@]" "$i" )
+      else
+	normal=( "$normal[@]" "$i" )
+      fi
+    done
+    (( $#dir ))    && compadd "$expl[@]" -UQ -qS/ -a dir
+    (( $#space ))  && compadd "$expl[@]" -UQ -qS " " -a space
+    (( $#normal )) && compadd "$expl[@]" -UQ -qS "" -a normal
+  fi
+  if _requested all-expansions expl 'all expansions'; then
+    local disp dstr
+
+    if [[ "${#${exp}}" -ge COLUMNS ]]; then
+      disp=( -ld dstr )
+      dstr=( "${(r:COLUMNS-5:)exp} ..." )
+    else
+      disp=()
+    fi
+    [[ -o multios ]] && exp=($exp[1] $compstate[redirect]${^exp[2,-1]})
+    compadd "$disp[@]" "$expl[@]" -UQ -qS "$suf" - "$exp"
+  fi
+
+  _requested original expl original && compadd "$expl[@]" -UQ - "$word"
+
+  compstate[insert]=menu
+fi
+
+return continue
diff --git a/Completion/Linux/Command/_valgrind b/Completion/Linux/Command/_valgrind
new file mode 100644
index 000000000..18778c5a4
--- /dev/null
+++ b/Completion/Linux/Command/_valgrind
@@ -0,0 +1,96 @@
+#compdef valgrind -value-,VALGRIND_OPTS,-default-
+
+local curcontext="$curcontext" state line common cmd
+local -a args args_{memcheck,addrcheck,cachegrind,helgrind,massif}
+
+cmd=(
+  '1:command name:_command_names -e'
+  '*::args :_normal'
+)
+
+if [[ $service = *_OPTS* ]]; then
+  compset -q
+  words=( fake "$words[@]" )
+  (( CURRENT++ ))
+  cmd=()
+fi
+
+common=(
+  '--sloppy-malloc=-[round malloc sizes to multiple of 4]:enable:(yes no)'
+  '--alignment=-[set minimum alignment of allocations]:number'
+)
+
+args_addrcheck=(
+  $common
+  '--partial-loads-ok=-:enable:(yes no)'
+  '--freelist-vol=-[volume of freed blocks queue]:blocks'
+  '--leak-check=-[search for memory leaks at exit]:enable:(yes no)'
+  '--leak-resolution=-[how much bt merging in leak check]:(low med high)'
+  '--show-reachable=-[show reachable blocks in leak check]:enable:(yes no)'
+  '--workaround-gcc296-bugs=-:enable:(yes no)'
+)
+
+args_memcheck=(
+  $args_addrcheck
+  '--avoid-strlen-errors=-[suppress errs from inlined strlen]:enable:(yes no)'
+)
+
+args_cachegrind=(
+  '--I1=-[set I1 cache manually]:size,assoc,line_size'
+  '--D1=-[set D1 cache manually]:size,assoc,line_size'
+  '--L2=-[set L2 cache manually]:size,assoc,line_size'
+)
+
+args_helgrind=(
+  $common
+  '--private-stacks=-[assume thread stacks are used privately]:enable:(yes no)'
+  '--show-last-access=-[show location of last word access on error]:locations:(no some all)'
+)
+
+args_massif=(
+  $common
+  '--heap=-[profile heap blocks]:enable:(yes no)'
+  '--heap-admin=-[specify average admin bytes per heap block]:bytes'
+  '--stacks=-[enable profile stacks]:enable:(yes no)'
+  '--depth=-[depth of contexts]:depth'
+  '--alloc-fn=-[specify alloc function]:function'
+  '--format=-[specify format of textual output]:format:(text html)'
+)
+
+args="args_${${words[(r)--(skin|tool)=*]#*=}:-memcheck}"
+
+_arguments -C ${(P)args} $cmd \
+  '(--tool --skin)'{--tool,--skin}'=-[specify valgrind tool]:valgrind tool:->tools' \
+  '(-h --help)'{-h,--help}'[show help information]' \
+  '--help-debug[show help info including debugging options]' \
+  '--version[show version]' \
+  '(-q --quiet)'{-q,--quiet}'[run silently; only print error msgs]' \
+  '(-v --verbose)'{-v,--verbose}'[be more verbose]' \
+  '--trace-children=-[valgrind-ise child processes]:enable:(yes no)' \
+  '--track-fds=-[track open file descriptors]:enable:(yes no)' \
+  '--time-stamp=-[add timestamps to log messages]:enable:(yes no)' \
+  '--run-libc-freeres=-[free up glibc memory at exit]:enable:(yes no)' \
+  '--weird-hacks=-[enable hack]:hack:(lax-ioctls)' \
+  '--signal-polltime=-[signal poll period (ms)]:period' \
+  '--lowlat-signals=-[improve thread signal wake-up latency]:enable:(yes no)' \
+  '--lowlat-syscalls=-[improve thread syscall wake-up latency]:enable:(yes no)' \
+  '--pointercheck=-[enforce client address space limits]:enable:(yes no)' \
+  '--log-fd=-[log messages to specified file descriptor]:file descriptor:_file_descriptors' \
+  '--log-file=-[log messages to specified file]:file:_files' \
+  '--log-socket=-[log messages to socket]:ipaddr\:port' \
+  '--demangle=-[automatically demangle C++ names]:enable:(yes no)' \
+  '--num-callers=-[specify no of callers to show in stack traces]:number' \
+  '--error-limit=-[stop showing new errors if too many]:enable:(yes no)' \
+  '--show-below-main=-[continue stack traces below main()]:enable:(yes no)' \
+  '--suppressions=-[suppress errors described in specified file]:file:_files' \
+  '--gen-suppressions=-[print suppressions for errors detected]:enable:(yes no)' \
+  '--db-attach=-[start debugger when errors detected]:enable:(yes no)' \
+  '--db-command=-[specify command to start debugger]:command:_command_names -e' \
+  '--input-fd=-[specify file descriptor for input]:file descriptor:_file_descriptors' && return
+
+if [[ -n "$state" ]]; then
+  _wanted tools exl 'valgrind tool' compadd ${=${${(f)"$(_call_program \
+      tools valgrind --tool= 2>&1)"}[(r)Available*,-1]}[2,-1]} && return
+fi
+
+return 1
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
new file mode 100644
index 000000000..b8d93beed
--- /dev/null
+++ b/Completion/Unix/Command/.distfiles
@@ -0,0 +1,31 @@
+DISTFILES_SRC='
+.distfiles
+_a2ps         _bittorrent   _darcs
+_dvi          _gzip         _man          _rcs          _w3m
+_apachectl    _enscript     _iconv        _mh           _rlogin       _webbrowser
+_cdrecord     _fakeroot     _imagemagick  _mount        _sh           _wget
+_arp          _fetchmail    _init_d       _mutt         _slrn         _whereis
+_bison        _find         _ispell       _mysql_utils  _socket       _whois
+_bzip2        _finger       _java         _ncftp        _ssh          _xargs
+_chown        _flex         _joe          _nslookup     _strip        _yodl
+_compress     _gcc          _killall      _pack         _stty         _yp
+_configure    _gdb          _look         _patch        _su           _zcat
+_cpio         _getconf      _lp           _pbm          _sudo         _zdump
+_cvs          _gnu_generic  _ls           _perl         _tar          _zip
+_dd           _gprof        _lynx         _perldoc      _telnet       _pine
+_dict         _grep         _lzop         _prcs         _tiff         _elm
+_diff         _gs           _make         _psutils      _tin	      _mail
+_last         _loadkeys     _ruby         _sysctl       _links        _samba
+_user_admin   _rsync        _arping	  _spamassassin _mtools       _ifconfig
+_fsh          _chkconfig    _cdcd         _irssi        _mysqldiff    _sccs
+_aap          _ant          _antiword     _apm          _attr
+_baz          _bogofilter
+_cal          _chmod        _du           _ecasound     _elinks       _figlet
+_getent       _global       _gpg          _gphoto2      _less         _lsof
+_mencal       _mt           _mtr          _netcat       _nice         _nmap
+_perforce     _php          _postfix      _printenv     _python
+_raggle       _rar	    _renice
+_sablotron    _screen       _sed          _subversion
+_texinfo      _tla          _tidy
+_unace        _uniq         _vorbis       _vux          _wiggle       _xmlsoft
+'
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
new file mode 100644
index 000000000..6ef0e733d
--- /dev/null
+++ b/Completion/Unix/Command/_ant
@@ -0,0 +1,102 @@
+#compdef ant -value-,ANT_ARGS,-default-
+
+typeset -A opt_args
+local buildfile tmp state line curcontext="$curcontext" ret=1
+local targets importedfiles
+local c target='*:target:->target'
+
+c=( $ANT_HOME/lib/*.jar )
+
+if [[ $service = *ANT_ARGS* ]]; then
+  compset -q
+  words=( fake "$words[@]" )
+  (( CURRENT++ ))
+  unset target
+fi
+
+_arguments -C \
+  '-help[display usage information]' \
+  '-projecthelp[print project help information]' \
+  '-version[display version information]' \
+  '-diagnostics[display info useful to problem diagnosis]' \
+  '(-q -quiet)'{-q,-quiet}'[be extra quiet]' \
+  '(-v -verbose)'{-v,-verbose}'[be more verbose]' \
+  '-debug[print debugging information]' \
+  '-emacs[produce logging information without adornments]' \
+  '(-l -logfile)'{-l,-logfile}'[use specified file for log]:logfile:_files' \
+  '-logger[the class which is to perform logging]:classname:_java_class -cp ${(j.:.)c}' \
+  '*-listener[add an instance of class as a project listener]:classname:_java_class -cp ${(j.:.)c}' \
+  '(-f -file -buildfile -find)'{-f,-file,-buildfile}'[use specified build file]:build file:_files' \
+  '*-D[specify property with value to use]:property:->property' \
+  '-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 && ret=0
+
+case $state in
+  property)
+    if compset -P '*='; then
+      _default
+    else
+      _message -e properties 'property name'
+    fi
+  ;;
+  target)
+    if zstyle -t ":completion:${curcontext}:targets" call-command; then
+      # Run ant -projecthelp also passing any of -find, -buildfile or -f options.
+      # Parse output into an array of the format "target:description".
+      # For the array to be set with correct argument boundaries, the entire
+      # set statement needs to be eval'd.  On Cygwin, need to kill \r's output
+      # from Java or parsing will fail.
+      eval set -A tmp "${$(_call_program targets "$words[1]" $buildxml -projecthelp |
+	while read target desc
+	do
+          # This loop reads ant -projecthelp output from versions 1.3 to 1.5
+          ln="${target}${desc:+:$desc}"
+          [[ $target = "" ]] && continue  # skip blank lines
+          case $ln in
+              (Buildfile:*)
+                  buildfile=$desc
+              ;;
+              (Default:target:*)
+                  # with version 1.5, target is on the same line
+                  default_target="${${desc/target:/}# }"
+                  # versions 1.3 and 1.4 with default target on a separate line
+                  if [[ -z $default_target ]]; then
+                      read junk
+                      read default_target junk
+                  fi
+                  # Output target again indicating its the default one.
+                  print -n "'${default_target}:(Default target) ' "
+              ;;
+              (Searching:*|Main:targets:|Subtargets:|BUILD:SUCCESSFUL|Total:time:
+	      *)
+              ;;
+              (*)
+                  # Return target and description
+                  print -n "'$ln' "
+              ;;
+          esac
+	done
+      )//$'\015'}"
+      _describe 'target' tmp && ret=0
+    else
+      if [[ -n $opt_args[-find] ]]; then
+	buildfile=( (../)#${opt_args[-find]:-build.xml}(N[-1]) )
+      else
+	buildfile=${(v)opt_args[(I)(-f|-file|-buildfile)]:-build.xml}
+      fi
+      if [[ -f $buildfile ]]; then
+        importedfiles=( $(sed -n "s/ *<import[^>]* file=[\"']\([^\"']*\)[\"'].*/\1/p" < $buildfile) )
+        targets=( $(sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" $buildfile) )
+        (( $#importedfiles )) && targets+=( $(cd $buildfile:h;
+	    sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" $importedfiles) )
+	_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/_iconv b/Completion/Unix/Command/_iconv
new file mode 100644
index 000000000..92fa17e34
--- /dev/null
+++ b/Completion/Unix/Command/_iconv
@@ -0,0 +1,55 @@
+#compdef iconv
+
+local expl curcontext="$curcontext" state line ret=1
+local LOCPATH="${LOCPATH:-/usr/lib/nls/loc}"
+local -U codeset
+
+if _pick_variant gnu=GNU unix --version; then
+
+  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
+    if compset -P '*/'; then
+      _wanted option expl option compadd "$@" /TRANSLIT && ret=0
+    else
+      _wanted codesets expl 'code set' compadd "$@" \
+	  -M 'm:{a-zA-Z}={A-Za-z} r:|-=* r:|=*' \
+	  ${${${(f)"$(_call_program codesets iconv --list|sed -n '/^$/,$ p')"}## #}%//} && ret=0
+    fi
+  fi
+
+  return ret
+else
+
+  _arguments -C \
+    '-f[specify code set of input file]:code set:->codeset' \
+    '-t[specify code set for output]:code set:->codeset' \
+    '1:file:_files' && return 0
+
+  if [[ $state = codeset ]]; then
+    if [[ -f /usr/lib/iconv/iconv_data ]]; then  # IRIX & Solaris
+      codeset=( ${${(f)"$(</usr/lib/iconv/iconv_data)"}%%[[:blank:]]*} )
+      codeset+=( /usr/lib/iconv/*%*.so(Ne.'reply=( ${${REPLY:t}%%%*} ${${REPLY:r}#*%} )'.) )
+    elif [[ -d $LOCPATH/iconv ]]; then  # OSF
+      codeset=( $LOCPATH/iconv/*(N:t) )
+      codeset=( ${(j:_:s:_:)codeset} )
+    else
+      return 1
+    fi
+
+    _wanted codesets expl 'code set' compadd "$@" -a codeset
+  fi
+
+fi
diff --git a/Completion/Unix/Command/_unace b/Completion/Unix/Command/_unace
new file mode 100644
index 000000000..8226ec28a
--- /dev/null
+++ b/Completion/Unix/Command/_unace
@@ -0,0 +1,18 @@
+#compdef unace
+
+_arguments -S \
+  '-c[show comments]' \
+  '-f[full path matching]' \
+  '-o[overwrite files]' \
+  '-p+[specify password]:password' \
+  '-y[assume yes on all queries]' \
+  '-x+[specify files to exclude]:files' \
+  '-h[print help information]' \
+  '1:unace command:((
+    e\:extract\ files
+    l\:list\ archive
+    t\:test\ archive\ integrity
+    v\:list\ archive\ \(verbose\)
+    x\:extract\ files\ with\ full\ path
+  ))' \
+  '*:files:_files -g "*.ace(-.)"'