about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-11-06 15:06:59 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-11-06 15:06:59 +0000
commitd39feeffc48330e4b16768f881306b75e7673971 (patch)
tree4a950e123288fdfa52283c79c048c2949eed228d /Completion
parent42f096be3422e46695798a01c7571bf0515ef1d6 (diff)
downloadzsh-d39feeffc48330e4b16768f881306b75e7673971.tar.gz
zsh-d39feeffc48330e4b16768f881306b75e7673971.tar.xz
zsh-d39feeffc48330e4b16768f881306b75e7673971.zip
16224: add -n option to kill and complete options from _kill
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Type/_signals17
-rw-r--r--Completion/Zsh/Command/_jobs_builtin2
-rw-r--r--Completion/Zsh/Command/_kill18
3 files changed, 24 insertions, 13 deletions
diff --git a/Completion/Unix/Type/_signals b/Completion/Unix/Type/_signals
index 447d9d16c..f882ca9ff 100644
--- a/Completion/Unix/Type/_signals
+++ b/Completion/Unix/Type/_signals
@@ -7,16 +7,15 @@
 #
 # A `-' or `--' as the first argument is ignored.
 
-local expl last=-3 minus
+local expl last minus
 
-while [[ "$1" = -[ap] ]]; do
-  if [[ "$1" = -a ]]; then
-    last=-1
-  else
-    minus=-
-  fi
-  shift
-done
+zparseopts -D -K -E 'p=minus' 'a=last'
+if [[ -z "$last" ]]; then
+  last=-1
+else
+  last=-3
+fi
+[[ -n "$minus" ]] && minus='-'
 
 [[ "$1" = -(|-) ]] && shift
 
diff --git a/Completion/Zsh/Command/_jobs_builtin b/Completion/Zsh/Command/_jobs_builtin
index 39ddb8a45..70804cf0f 100644
--- a/Completion/Zsh/Command/_jobs_builtin
+++ b/Completion/Zsh/Command/_jobs_builtin
@@ -2,7 +2,7 @@
 
 _arguments -C -s \
   "(-d -l -p -r -s *)-Z[specify string to replace shell's argument and environment with]:string" \
-  '(-Z)-d[show directory from which to job was started]' \
+  '(-Z)-d[show directory from which each job was started]' \
   '(-Z)-l[list process IDs]' \
   '(-Z)-p[list process groups]' \
   '(-Z -s)-r[list only running jobs]' \
diff --git a/Completion/Zsh/Command/_kill b/Completion/Zsh/Command/_kill
index 5e3caed6a..8887be5fc 100644
--- a/Completion/Zsh/Command/_kill
+++ b/Completion/Zsh/Command/_kill
@@ -1,6 +1,18 @@
 #compdef kill
 
-_alternative \
-    'signals:: _signals -p' \
+local curcontext="$curcontext" line state ret=1
+
+_arguments -C \
+  '(-s -l 1)-n[specify signal number]:signal number' \
+  '(-n -l 1)-s[specify signal name]:signal:_signals' \
+  '(-n -s)-l[list signal names or numbers of specified signals]:*:signal:_signals' \
+  '(-n -s -l)1::signal:_signals -p' \
+  '*:processes:->processes' && ret=0
+  
+if [[ -n "$state" && -prefix [%0-9]# ]]; then
+  _alternative \
     'processes:: _pids' \
-    'jobs:: _jobs -t'
+    'jobs:: _jobs -t' && ret=0
+fi
+
+return ret