about summary refs log tree commit diff
path: root/Completion/Builtins
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>1999-11-19 09:20:30 +0000
committerTanaka Akira <akr@users.sourceforge.net>1999-11-19 09:20:30 +0000
commit47e098e407f8c65cb9e45bf8483515b5a05803fd (patch)
tree4bd0682ae2c6d6486b20993f2c5029e2243c26df /Completion/Builtins
parentd349d2f1cd18c49fbda8d419e262520db5c5e912 (diff)
downloadzsh-47e098e407f8c65cb9e45bf8483515b5a05803fd.tar.gz
zsh-47e098e407f8c65cb9e45bf8483515b5a05803fd.tar.xz
zsh-47e098e407f8c65cb9e45bf8483515b5a05803fd.zip
Initial revision
Diffstat (limited to 'Completion/Builtins')
-rw-r--r--Completion/Builtins/_signals36
1 files changed, 36 insertions, 0 deletions
diff --git a/Completion/Builtins/_signals b/Completion/Builtins/_signals
new file mode 100644
index 000000000..c79350044
--- /dev/null
+++ b/Completion/Builtins/_signals
@@ -0,0 +1,36 @@
+#autoload
+
+# Options (only in separate words):
+#
+# -a  use all signals (even the pseudo-signals)
+# -p  needs a `-' prefix
+#
+# A `-' or `--' as the first argument is ignored.
+
+local expl last=-3 minus
+
+while [[ "$1" = -[ap] ]]; do
+  if [[ "$1" = -a ]]; then
+    last=-1
+  else
+    minus=-
+  fi
+  shift
+done
+
+[[ "$1" = -(|-) ]] && shift
+
+if _wanted signals expl signal &&
+       { [[ -z "$minus" ]] || ! _style signals prefix-needed ||
+         [[ "$PREFIX" = -* ]] } ; then
+  local disp tmp
+
+  if _style signals prefix-hidden; then
+    tmp=( "${(@)signals[1,last]}" )
+    disp=(-d tmp)
+  else
+    disp=()
+  fi
+  compadd "$@" "$expl[@]" "$disp[@]" -M 'm:{a-z}=${A-Z}' - \
+          "${minus}${(@)^signals[1,last]}"
+fi