@@ -14,7 +14,7 @@ case $variant in
1414 '(-b --beep)'{-b,--beep}'[beep on non-zero command exit]' \
1515 '(-c --color)'{-c,--color}'[interpret ANSI color/style sequences]' \
1616 '(-d --differences)'{-d-,--differences=-}'[highlight changes between updates]::how to highlight:(permanent)' \
17- '(-e --errexit)'{-e,--errexit}'[freeze updates on non-zero command exit]' \
17+ '(-e --errexit)'{-e,--errexit}'[pause updating if command exits with a non-zero exit code ]' \
1818 '(-g --chgexit)'{-g,--chgexit}'[exit on command output change]' \
1919 '(-n --interval)'{-n+,--interval=}'[specify update interval]:update interval (seconds) [2]' \
2020 '(-p --precise)'{-p,--precise}'[run command at precise intervals]' \
@@ -23,23 +23,32 @@ case $variant in
2323 '(-t --no-title)'{-t,--no-title}'[disable header]' \
2424 '(-w --no-wrap)'{-w,--no-wrap}'[disable line wrapping]' \
2525 '(-x --exec)'{-x,--exec}'[pass command to exec(2) instead of `sh -c`]' \
26- '(-)*::: :->cmd' \
27- && ret=0
28-
29- [[ $state == cmd ]] &&
30- if
31- (( CURRENT == 1 )) &&
32- [[ $words[1] == (\"|\'|\$\')* ]] &&
33- [[ -z $opt_args[(i)(-x|--exec)] ]]
34- then
35- _cmdstring && ret=0
36- else
37- _normal -p watch && ret=0
38- fi
39- ;;
26+ '(-)*::: :->cmd' && ret=0
27+ ;;
28+ openbsd*)
29+ _arguments -s -A "-*" \
30+ '(-l -w)-c[highlight changed characters]' \
31+ '-e[pause updating if command exits with a non-zero exit code]' \
32+ '(-c -w)-l[highlight changed lines]' \
33+ '-s[set the interval between updates]: :_numbers -d 1 -u seconds interval' \
34+ '(-c -l)-w[highlight changed words]' \
35+ '-x[pass command to execl(3) instead of `sh -c`]' \
36+ '(-)*::: :->cmd' && ret=0
37+ ;;
4038 # watch(1) has completely different semantics on freebsd compared to linux, hence:
4139 (freebsd*|dragonfly*) _watch-snoop "$@" && ret=0 ;;
4240 (*) _default && ret=0 ;;
4341esac
4442
43+ [[ $state == cmd ]] &&
44+ if
45+ (( CURRENT == 1 )) &&
46+ [[ $words[1] == (\"|\'|\$\')* ]] &&
47+ [[ -z $opt_args[(i)(-x|--exec)] ]]
48+ then
49+ _cmdstring && ret=0
50+ else
51+ _normal -p watch && ret=0
52+ fi
53+
4554return ret
0 commit comments