about summary refs log tree commit diff
path: root/Completion/Unix/Type/_arch_archives
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2005-04-16 20:22:44 +0000
committerClint Adams <clint@users.sourceforge.net>2005-04-16 20:22:44 +0000
commit89f3361e60ec1da55f53a632a98d834b9f27e2cf (patch)
tree725f9b422aa3c92b24d3abb5743a7ed0c681784e /Completion/Unix/Type/_arch_archives
parentd6089cc8b17ed7d33850bb9075a9c6771fe120d6 (diff)
downloadzsh-89f3361e60ec1da55f53a632a98d834b9f27e2cf.tar.gz
zsh-89f3361e60ec1da55f53a632a98d834b9f27e2cf.tar.xz
zsh-89f3361e60ec1da55f53a632a98d834b9f27e2cf.zip
* 21147: factor out some common code from _tla and _baz, and fix some breakage
   from 21075.
Diffstat (limited to 'Completion/Unix/Type/_arch_archives')
-rw-r--r--Completion/Unix/Type/_arch_archives14
1 files changed, 14 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_arch_archives b/Completion/Unix/Type/_arch_archives
new file mode 100644
index 000000000..9ffd7e3d3
--- /dev/null
+++ b/Completion/Unix/Type/_arch_archives
@@ -0,0 +1,14 @@
+#autoload
+
+local ARCHCMD="$1"
+shift
+local expl completions library name_arg='-n'
+if [[ -n $argv[(r)--library] ]]; then
+  library='library-'
+  # remove parameter from $@ before calling compadd
+  argv[(r)--library]=()
+  name_arg=
+fi
+completions=($(_call_program ${ARCHCMD} ${ARCHCMD} ${library:-}archives $name_arg))
+_description -V archives expl "${library:-}archives"
+compadd "$@" "$expl[@]" -- "$completions[@]"