diff options
Diffstat (limited to 'Completion')
-rw-r--r-- | Completion/Unix/Type/_signals | 17 | ||||
-rw-r--r-- | Completion/Zsh/Command/_jobs_builtin | 2 | ||||
-rw-r--r-- | Completion/Zsh/Command/_kill | 18 |
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 |