2019-10-21 15:15:37 +02:00
|
|
|
#compdef watchexec
|
|
|
|
|
|
|
|
setopt localoptions extended_glob
|
|
|
|
|
|
|
|
local cmd
|
|
|
|
local -a args
|
|
|
|
local -a _comp_priv_prefix
|
|
|
|
|
|
|
|
cmd="$words[1]"
|
|
|
|
|
|
|
|
args=(
|
|
|
|
'(-c --clear)'{-c,--clear}'[Clear screen before executing command]'
|
|
|
|
'(-h --help)'{-h,--help}'[Prints help information]'
|
2021-04-10 17:31:44 +02:00
|
|
|
'--shell=[Change the wrapping shell, or set to none to disable]'
|
2021-04-10 16:51:20 +02:00
|
|
|
'--no-shell[Deprecated, use --shell=none]'
|
|
|
|
'-n[Shorthand for --shell=none]'
|
2021-04-10 17:21:38 +02:00
|
|
|
'--no-environment[Do not set WATCHEXEC_*_PATH environment variables for command]'
|
2020-06-23 14:13:07 +02:00
|
|
|
'--no-meta[Ignore metadata changes]'
|
2019-10-21 15:15:37 +02:00
|
|
|
'(-p --postpone)'{-p,--postpone}'[Wait until first change to execute command]'
|
|
|
|
'(-r --restart)'{-r,--restart}'[Restart the process if it''s still running]'
|
2021-04-10 17:31:44 +02:00
|
|
|
'(-W --watch-when-idle)'{-W,--watch-when-idle}'[Ignore events while the command is still running]'
|
2019-10-21 15:15:37 +02:00
|
|
|
'(-V --version)'{-V,--version}'[Prints version information]'
|
|
|
|
'(-v --verbose)'{-v,--verbose}'[Print debugging messages to stderr]'
|
2021-04-10 14:01:02 +02:00
|
|
|
'--changes-only[Print changed paths to stderr for pattern debugging]'
|
2021-07-21 13:44:24 +02:00
|
|
|
'(-d --debounce)'{-d+,--debounce=}'[Set the timeout between detected change and command execution, defaults to 100ms]:milliseconds'
|
2019-10-21 15:15:37 +02:00
|
|
|
'(-e --exts)'{-e+,--exts=}'[Comma-separated list of file extensions to watch (js,css,html)]:extensions'
|
|
|
|
'(-f --filter)'{-f+,--filter=}'[Ignore all modifications except those matching the pattern]:pattern'
|
|
|
|
'(-i --ignore)'{-i+,--ignore=}'[Ignore modifications to paths matching the pattern]:pattern'
|
|
|
|
'(-w --watch)'{-w+,--watch=}'[Watch a specific directory]:path:_path_files -/'
|
|
|
|
'(-s --signal)'{-s+,--signal=}'[Send signal to process upon changes, e.g. SIGHUP]:signal'
|
|
|
|
'--force-poll=[Forces polling mode]:interval'
|
2019-10-22 10:11:40 +02:00
|
|
|
'--no-ignore[Skip auto-loading of ignore files (.gitignore, .ignore, etc.) for filtering]'
|
2019-10-21 15:15:37 +02:00
|
|
|
'--no-default-ignore[Skip auto-ignoring of commonly ignored globs]'
|
|
|
|
'--no-vcs-ignore[Skip auto-loading of .gitignore files for filtering]'
|
|
|
|
'(-)1:command: _command_names -e'
|
|
|
|
'*::arguments:{ _comp_priv_prefix=( $cmd -n ${(kv)opt_args[-u]} ) ; _normal }'
|
|
|
|
)
|
|
|
|
|
|
|
|
_arguments -s -S $args
|