diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2018-12-24 04:40:22 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2018-12-24 04:40:22 +0100 |
commit | bf8b7f713a5b04a191f4596fb86bbbfca0a855ce (patch) | |
tree | b647a8dc990c8c845b8a8eca7bf92fbbf17e1fb5 /Completion/Unix/Command/_watch | |
parent | 06946d431a4426c6e5dffec1d7edb17c1dbd467c (diff) | |
parent | 9dbde9e9c7d22ee0d301e4a2fecf97906d1ddce9 (diff) | |
download | zsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.tar.gz zsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.zip |
New upstream release candidate 5.6.2-test-2
Merge branch 'upstream' at 'zsh-5.6.2-test-2' into branch debian
Diffstat (limited to 'Completion/Unix/Command/_watch')
-rw-r--r-- | Completion/Unix/Command/_watch | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/Completion/Unix/Command/_watch b/Completion/Unix/Command/_watch index a8d29403f..fff3d56f6 100644 --- a/Completion/Unix/Command/_watch +++ b/Completion/Unix/Command/_watch @@ -1,9 +1,42 @@ #compdef watch -# watch(1) has completely different semantics on freebsd compared to linux, hence: -case $OSTYPE in - (freebsd*|dragonfly*) _watch-snoop "$@";; - (*) _default;; +local variant ret=1 +local -a context line state state_descr +local -A opt_args + +_pick_variant -r variant procps=procps $OSTYPE --version + +case $variant in + (procps) + _arguments -s -S -A '-*' : \ + '(: * -)'{-h,--help}'[display help information]' \ + '(: * -)'{-v,--version}'[display version information]' \ + '(-b --beep)'{-b,--beep}'[beep on non-zero command exit]' \ + '(-c --color)'{-c,--color}'[interpret ANSI color/style sequences]' \ + '(-d --differences)'{-d-,--differences=-}'[highlight changes between updates]::how to highlight:(permanent)' \ + '(-e --errexit)'{-e,--errexit}'[freeze updates on non-zero command exit]' \ + '(-g --chgexit)'{-g,--chgexit}'[exit on command output change]' \ + '(-n --interval)'{-n+,--interval=}'[specify update interval]:update interval (seconds) [2]' \ + '(-p --precise)'{-p,--precise}'[run command at precise intervals]' \ + '(-t --no-title)'{-t,--no-title}'[disable header]' \ + '(-x --exec)'{-x,--exec}'[pass command to exec(2) instead of `sh -c`]' \ + '(-)*::: :->cmd' \ + && ret=0 + + [[ $state == cmd ]] && + if + (( CURRENT == 1 )) && + [[ $words[1] == (\"|\'|\$\')* ]] && + [[ -z $opt_args[(i)(-x|--exec)] ]] + then + _cmdstring && ret=0 + else + _normal && ret=0 + fi + ;; + # watch(1) has completely different semantics on freebsd compared to linux, hence: + (freebsd*|dragonfly*) _watch-snoop "$@" && ret=0 ;; + (*) _default && ret=0 ;; esac -# NOTREACHED +return ret |