about summary refs log tree commit diff
path: root/Completion/Zsh/Type
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Zsh/Type')
-rw-r--r--Completion/Zsh/Type/_arrays5
-rw-r--r--Completion/Zsh/Type/_file_descriptors29
-rw-r--r--Completion/Zsh/Type/_functions5
-rw-r--r--Completion/Zsh/Type/_jobs_bg3
-rw-r--r--Completion/Zsh/Type/_jobs_fg3
-rw-r--r--Completion/Zsh/Type/_limits5
-rw-r--r--Completion/Zsh/Type/_options8
-rw-r--r--Completion/Zsh/Type/_options_set10
-rw-r--r--Completion/Zsh/Type/_options_unset10
9 files changed, 78 insertions, 0 deletions
diff --git a/Completion/Zsh/Type/_arrays b/Completion/Zsh/Type/_arrays
new file mode 100644
index 000000000..24c8957e8
--- /dev/null
+++ b/Completion/Zsh/Type/_arrays
@@ -0,0 +1,5 @@
+#compdef shift
+
+local expl
+
+_wanted arrays expl array _parameters "$@" - -g '*array*'
diff --git a/Completion/Zsh/Type/_file_descriptors b/Completion/Zsh/Type/_file_descriptors
new file mode 100644
index 000000000..6d21ed2b6
--- /dev/null
+++ b/Completion/Zsh/Type/_file_descriptors
@@ -0,0 +1,29 @@
+#autoload
+
+local i fds expl list link sep
+
+for i in {0..9}; [[ -e /dev/fd/$i ]] && fds+=( $i )
+
+if zstyle -T ":completion:${curcontext}:" verbose && [[ -e /proc/$$/fd ]]; then
+  zstyle -s ":completion:${curcontext}:" list-separator sep || sep=--
+
+  if zmodload -e zsh/stat; then
+    for i in "${fds[@]}"; do
+      stat +link -A link /proc/$$/fd/$i
+      list+=( "$i $sep ${link[1]}" )
+    done
+  elif (( $+commands[readlink] )); then
+    for i in "${fds[@]}"; list+=( "$i $sep $(readlink /proc/$$/fd/$i)" )
+  else
+    for i in "${fds[@]}"; do
+      list+=( "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" )
+    done
+  fi
+
+  if (( $list[(I)* $sep ?*] )); then
+    _wanted file-descriptors expl 'file descriptor' compadd "$@" -d list -a - fds
+    return
+  fi
+fi
+
+_wanted file-descriptors expl 'file descriptor' compadd -a "$@" - fds
diff --git a/Completion/Zsh/Type/_functions b/Completion/Zsh/Type/_functions
new file mode 100644
index 000000000..912a7f134
--- /dev/null
+++ b/Completion/Zsh/Type/_functions
@@ -0,0 +1,5 @@
+#compdef unfunction
+
+local expl
+
+_wanted functions expl 'shell function' compadd -k "$@" - functions
diff --git a/Completion/Zsh/Type/_jobs_bg b/Completion/Zsh/Type/_jobs_bg
new file mode 100644
index 000000000..0c1842203
--- /dev/null
+++ b/Completion/Zsh/Type/_jobs_bg
@@ -0,0 +1,3 @@
+#compdef bg
+
+_jobs -s "$@"
diff --git a/Completion/Zsh/Type/_jobs_fg b/Completion/Zsh/Type/_jobs_fg
new file mode 100644
index 000000000..57117f0d6
--- /dev/null
+++ b/Completion/Zsh/Type/_jobs_fg
@@ -0,0 +1,3 @@
+#compdef disown fg
+
+_jobs "$@"
diff --git a/Completion/Zsh/Type/_limits b/Completion/Zsh/Type/_limits
new file mode 100644
index 000000000..11ee7efaa
--- /dev/null
+++ b/Completion/Zsh/Type/_limits
@@ -0,0 +1,5 @@
+#compdef unlimit
+
+local expl
+
+_wanted limits expl 'process limit' compadd "$@" - ${${(f)"$(limit)"}%% *}
diff --git a/Completion/Zsh/Type/_options b/Completion/Zsh/Type/_options
new file mode 100644
index 000000000..c6cf30d99
--- /dev/null
+++ b/Completion/Zsh/Type/_options
@@ -0,0 +1,8 @@
+#autoload
+
+# This should be used to complete all option names.
+
+local expl
+
+_wanted zsh-options expl 'zsh option' \
+    compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -k - options
diff --git a/Completion/Zsh/Type/_options_set b/Completion/Zsh/Type/_options_set
new file mode 100644
index 000000000..ddb57c3e2
--- /dev/null
+++ b/Completion/Zsh/Type/_options_set
@@ -0,0 +1,10 @@
+#autoload
+
+# Complete all set options. This relies on `_main_complete' to store the
+# names of the options that were set when it was called in the array
+# `_options_set'.
+
+local expl
+
+_wanted zsh-options expl 'set zsh option' \
+    compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a - _options_set
diff --git a/Completion/Zsh/Type/_options_unset b/Completion/Zsh/Type/_options_unset
new file mode 100644
index 000000000..32d58d427
--- /dev/null
+++ b/Completion/Zsh/Type/_options_unset
@@ -0,0 +1,10 @@
+#autoload
+
+# Complete all unset options. This relies on `_main_complete' to store the
+# names of the options that were unset when it was called in the array
+# `_options_unset'.
+
+local expl
+
+_wanted zsh-options expl 'unset zsh option' \
+    compadd "$@" -M 'B:[nN][oO]= M:_= M:{A-Z}={a-z}' -a - _options_unset