\fR
+Set the working directory of the command (not of Watchexec itself!)\. By default not set, and inherited from the Watchexec instance as is usual\.
+.
+.SS "Filtering options"
.
.TP
-\fB\-n\fR
-Shorthand for \fB\-\-shell=none\fR\.
+\fB\-e\fR, \fB\-\-exts\fR \fIextensions\fR
+Comma\-separated list of file extensions to filter by\. Leading dots (\.rs) are allowed\. (This is a shorthand for \fB\-f\fR)\.
.
.TP
-\fB\-\-no\-meta\fR
-Ignore metadata changes\.
-.
-.TP
-\fB\-\-no\-environment\fR
-Do not set WATCHEXEC\fI*\fRPATH environment variables for the command\.
+\fB\-f\fR, \fB\-\-filter\fR \fIpattern\fR
+Ignores modifications from paths that do not match \fIpattern\fR\. This option can be specified multiple times, where a match on any given pattern causes the path to trigger \fIcommand\fR\.
.
.TP
\fB\-i\fR, \fB\-\-ignore\fR \fIpattern\fR
Ignores modifications from paths that match \fIpattern\fR\. This option can be specified multiple times, and a match on any pattern causes the path to be ignored\.
.
.TP
-\fB\-w\fR, \fB\-\-watch\fR \fIpath\fR
-Monitor a specific path for changes\. By default, the current working directory is watched\. This may be specified multiple times, where a change in any watched directory (and subdirectories) causes \fIcommand\fR to be executed\.
-.
-.TP
-\fB\-r\fR, \fB\-\-restart\fR
-Terminates the command if it is still running when subsequent file modifications are detected\. By default, sends \fBSIGTERM\fR; use \fB\-\-signal\fR to change that\.
-.
-.TP
-\fB\-W\fR, \fB\-\-watch\-when\-idle\fR
-Ignore events while the process is still running\. This is distinct from \fB\-\-restart\fR in that with this option, events received while the command is running will not trigger a new run immediately after the current command is done\.
-.
-.P
-This behaviour will become the default in v2\.0\.
-.
-.TP
-\fB\-\-no\-process\-group\fR
-Do not use a process group when running \fIcommand\fR\.
-.
-.TP
-\fB\-c\fR, \fB\-\-clear\fR
-Clears the screen before executing \fIcommand\fR\.
-.
-.TP
-\fB\-p\fR, \fB\-\-postpone\fR
-Postpone execution of \fIcommand\fR until the first file modification is detected\.
-.
-.TP
-\fB\-\-force\-poll\fR \fIinterval\fR
-Poll for changes every \fIinterval\fR ms instead of using system\-specific notification mechanisms (such as inotify)\. This is useful when you are monitoring NFS shares\.
-.
-.TP
-\fB\-d\fR, \fB\-\-debounce\fR
-Set the timeout between detected change and command execution, to avoid restarting too frequently when there are many events; defaults to 100ms\.
-.
-.TP
-\fB\-\-no\-vcs\-ignore\fR
-Skip loading of version control system (VCS) ignore files\. By default, watchexec loads \.gitignore, \.hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events\.
-.
-.TP
-\fB\-\-no\-project\-ignore\fR, \fB\-\-no\-ignore\fR (deprecated alias)
-Skip loading of project\-local ignore files (include VCS ignore files)\. By default, watchexec loads \.ignore, \.gitignore, \.hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events\.
-.
-.TP
\fB\-\-no\-default\-ignore\fR
Skip default ignore statements\. By default, watchexec ignores common temporary files for you, for example \fB*\.swp\fR, \fB*\.pyc\fR, and \fB\.DS_Store\fR, as well as the data directories of known VCS: \fB\.bzr\fR, \fB_darcs\fR, \fB\.fossil\-settings\fR, \fB\.git\fR, \fB\.hg\fR, \fB\.pijul\fR, and \fB\.svn\fR\.
.
@@ -127,16 +92,76 @@ Skip default ignore statements\. By default, watchexec ignores common temporary
Skip loading of global ignore files\. By default, watchexec loads $HOME/\.gitignore and other such global files and uses them to filter change events\.
.
.TP
-\fB\-v\fR, \fB\-\-verbose\fR, \fB\-vv\fR, etc
-Prints diagnostic and debugging messages to STDERR\. Increase the amount of \fBv\fRs to get progressively more output: for bug reports use \fBthree\fR, and for deep debugging \fBfour\fR can be helpful\.
+\fB\-\-no\-meta\fR
+Ignore metadata changes\.
+.
+.TP
+\fB\-\-no\-project\-ignore\fR, \fB\-\-no\-ignore\fR (deprecated alias)
+Skip loading of project\-local ignore files (include VCS ignore files)\. By default, watchexec loads \.ignore, \.gitignore, \.hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events\.
+.
+.P
+The \fB\-\-no\-ignore\fR alias will be replaced by a new option in 2\.0\.0, beware!
+.
+.TP
+\fB\-\-no\-vcs\-ignore\fR
+Skip loading of version control system (VCS) ignore files\. By default, watchexec loads \.gitignore, \.hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events\.
+.
+.TP
+\fB\-\-project\-origin\fR \fIpath\fR
+Overrides the project origin, where ignore files are resolved from (see \fIPATHS\fR section below)\.
+.
+.TP
+\fB\-w\fR, \fB\-\-watch\fR \fIpath\fR
+Monitor a specific path for changes\. By default, the current working directory is watched\. This may be specified multiple times, where a change in any watched directory (and subdirectories) causes \fIcommand\fR to be executed\.
+.
+.SS "Behaviour options"
+.
+.TP
+\fB\-d\fR, \fB\-\-debounce\fR
+Set the timeout between detected change and command execution, to avoid restarting too frequently when there are many events; defaults to 100ms\.
+.
+.TP
+\fB\-\-force\-poll\fR \fIinterval\fR
+Poll for changes every \fIinterval\fR ms instead of using system\-specific notification mechanisms (such as inotify)\. This is useful when you are monitoring NFS shares\.
+.
+.TP
+\fB\-p\fR, \fB\-\-postpone\fR
+Postpone execution of \fIcommand\fR until the first file modification is detected\.
+.
+.TP
+\fB\-r\fR, \fB\-\-restart\fR
+Terminates the command if it is still running when subsequent file modifications are detected\. By default, sends \fBSIGTERM\fR; use \fB\-\-signal\fR to change that\.
+.
+.TP
+\fB\-s\fR, \fB\-\-signal\fR
+Sends the specified signal (e\.g\. \fBSIGKILL\fR) to the command\. Defaults to \fBSIGTERM\fR\.
+.
+.TP
+\fB\-W\fR, \fB\-\-watch\-when\-idle\fR
+Ignore events while the process is still running\. This is distinct from \fB\-\-restart\fR in that with this option, events received while the command is running will not trigger a new run immediately after the current command is done\.
+.
+.P
+This behaviour will become the default in v2\.0\.
+.
+.SS "Output options"
+.
+.TP
+\fB\-c\fR, \fB\-\-clear\fR
+Clears the screen before executing \fIcommand\fR\.
+.
+.TP
+\fB\-N\fR, \fB\-\-notify\fR
+Sends desktop notifications on command start and command end\.
+.
+.SS "Debugging options"
.
.TP
\fB\-\-print\-events\fR, \fB\-\-changes\-only\fR (deprecated alias)
Prints the events (changed paths, etc) that have triggered an action to STDERR\.
.
.TP
-\fB\-N\fR, \fB\-\-notify\fR
-Sends desktop notifications on command start and command end\.
+\fB\-v\fR, \fB\-\-verbose\fR, \fB\-vv\fR, etc
+Prints diagnostic and debugging messages to STDERR\. Increase the amount of \fBv\fRs to get progressively more output: for bug reports use \fBthree\fR, and for deep debugging \fBfour\fR can be helpful\.
.
.TP
\fB\-V\fR, \fB\-\-version\fR
@@ -161,6 +186,9 @@ The overall project origin is used to find and resolve ignore files, such that i
.P
For this reason, it is not recommended to use Watchexec for watching disparate folders in a filesystem, where those would resolve to a too\-broad project origin\.
.
+.P
+The project origin can be overridden with the \fB\-\-project\-origin\fR option\.
+.
.SH "ENVIRONMENT"
In variables that contain lists of paths, the separator is as for the \fB$PATH\fR environment variable (a colon, or semicolon on Windows)\.
.
diff --git a/doc/watchexec.1.html b/doc/watchexec.1.html
index 62f740d..1213154 100644
--- a/doc/watchexec.1.html
+++ b/doc/watchexec.1.html
@@ -82,7 +82,9 @@
SYNOPSIS
-watchexec [--exts
| -e
extensions]... [--filter
| -f
pattern]... [--ignore
| -i
pattern]... [--watch
| -w
path]... [--restart
| -r
] [--clear
| -c
] [--postpone
| -p
] [--force-poll
interval] [--debounce
| -d
interval] [--no-vcs-ignore
] [--no-default-ignore
] [--verbose
| -v
| -vv
| -vvv
| -vvvv
] [--changes-only
] [--version
| -V
] [--] command [argument...]
+watchexec [OPTIONS] [--] command [argument...]
+watchexec -V|--version
+watchexec [-h|--help]
DESCRIPTION
@@ -92,6 +94,8 @@
OPTIONS
+Command options
+
- command
- Command to run when watched files are modified, and at startup, unless
--postpone
is specified. All arguments are passed to command. If you pass flags to the command, you should separate it with --
, for example: watchexec -w src -- rsync -a src dest
.
@@ -100,9 +104,11 @@
Behaviour depends on the value of --shell
: for all except none
, every part of command is joined together into one string with a single ascii space character, and given to the shell as described. For none
, each distinct element of command is passed as per the execvp(3) convention: first argument is the program, as a file or searched in the PATH
, rest are arguments.
--e
, --exts
extensionsComma-separated list of file extensions to filter by. Leading dots (.rs) are allowed. (This is a shorthand for -f
).
--f
, --filter
patternIgnores modifications from paths that do not match pattern. This option can be specified multiple times, where a match on any given pattern causes the path to trigger command.
--s
, --signal
Sends the specified signal (e.g. SIGKILL
) to the command. Defaults to SIGTERM
.
+-E
, --env
key=value pairSet additional environment variables on the command (not to Watchexec itself). Can be given multiple times (one per variable to set).
+-n
Shorthand for --shell=none
.
+--no-process-group
Do not use a process group when running command.
+--no-environment
Do not set WATCHEXEC*PATH environment variables for the command.
+--no-shell
Deprecated. Alias for --shell=none
.
--shell
shellChange the shell used to run the command. Set to none
to run the command directly without a shell.
@@ -118,32 +124,59 @@
See the EXAMPLES for uses of each of these.
---no-shell
Deprecated. Alias for --shell=none
.
--n
Shorthand for --shell=none
.
---no-meta
Ignore metadata changes.
---no-environment
Do not set WATCHEXEC*PATH environment variables for the command.
+--workdir <path>
- Set the working directory of the command (not of Watchexec itself!). By default not set, and inherited from the Watchexec instance as is usual.
+
+
+
+Filtering options
+
+
+-e
, --exts
extensionsComma-separated list of file extensions to filter by. Leading dots (.rs) are allowed. (This is a shorthand for -f
).
+-f
, --filter
patternIgnores modifications from paths that do not match pattern. This option can be specified multiple times, where a match on any given pattern causes the path to trigger command.
-i
, --ignore
patternIgnores modifications from paths that match pattern. This option can be specified multiple times, and a match on any pattern causes the path to be ignored.
+--no-default-ignore
Skip default ignore statements. By default, watchexec ignores common temporary files for you, for example *.swp
, *.pyc
, and .DS_Store
, as well as the data directories of known VCS: .bzr
, _darcs
, .fossil-settings
, .git
, .hg
, .pijul
, and .svn
.
+--no-global-ignore
Skip loading of global ignore files. By default, watchexec loads $HOME/.gitignore and other such global files and uses them to filter change events.
+--no-meta
Ignore metadata changes.
+--no-project-ignore
, --no-ignore
(deprecated alias)Skip loading of project-local ignore files (include VCS ignore files). By default, watchexec loads .ignore, .gitignore, .hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events.
+
+
+
+The --no-ignore
alias will be replaced by a new option in 2.0.0, beware!
+
+
+--no-vcs-ignore
Skip loading of version control system (VCS) ignore files. By default, watchexec loads .gitignore, .hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events.
+--project-origin
pathOverrides the project origin, where ignore files are resolved from (see PATHS section below).
-w
, --watch
pathMonitor a specific path for changes. By default, the current working directory is watched. This may be specified multiple times, where a change in any watched directory (and subdirectories) causes command to be executed.
+
+
+
+Behaviour options
+
+
+-d
, --debounce
Set the timeout between detected change and command execution, to avoid restarting too frequently when there are many events; defaults to 100ms.
+--force-poll
intervalPoll for changes every interval ms instead of using system-specific notification mechanisms (such as inotify). This is useful when you are monitoring NFS shares.
+-p
, --postpone
Postpone execution of command until the first file modification is detected.
-r
, --restart
Terminates the command if it is still running when subsequent file modifications are detected. By default, sends SIGTERM
; use --signal
to change that.
+-s
, --signal
Sends the specified signal (e.g. SIGKILL
) to the command. Defaults to SIGTERM
.
-W
, --watch-when-idle
Ignore events while the process is still running. This is distinct from --restart
in that with this option, events received while the command is running will not trigger a new run immediately after the current command is done.
This behaviour will become the default in v2.0.
+Output options
+
---no-process-group
Do not use a process group when running command.
-c
, --clear
Clears the screen before executing command.
--p
, --postpone
Postpone execution of command until the first file modification is detected.
---force-poll
intervalPoll for changes every interval ms instead of using system-specific notification mechanisms (such as inotify). This is useful when you are monitoring NFS shares.
--d
, --debounce
Set the timeout between detected change and command execution, to avoid restarting too frequently when there are many events; defaults to 100ms.
---no-vcs-ignore
Skip loading of version control system (VCS) ignore files. By default, watchexec loads .gitignore, .hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events.
---no-project-ignore
, --no-ignore
(deprecated alias)Skip loading of project-local ignore files (include VCS ignore files). By default, watchexec loads .ignore, .gitignore, .hgignore, and other such files in the current directory (or child directories as applicable) and uses them to filter change events.
---no-default-ignore
Skip default ignore statements. By default, watchexec ignores common temporary files for you, for example *.swp
, *.pyc
, and .DS_Store
, as well as the data directories of known VCS: .bzr
, _darcs
, .fossil-settings
, .git
, .hg
, .pijul
, and .svn
.
---no-global-ignore
Skip loading of global ignore files. By default, watchexec loads $HOME/.gitignore and other such global files and uses them to filter change events.
--v
, --verbose
, -vv
, etcPrints diagnostic and debugging messages to STDERR. Increase the amount of v
s to get progressively more output: for bug reports use three, and for deep debugging four can be helpful.
---print-events
, --changes-only
(deprecated alias)Prints the events (changed paths, etc) that have triggered an action to STDERR.
-N
, --notify
Sends desktop notifications on command start and command end.
+
+
+
+Debugging options
+
+
+--print-events
, --changes-only
(deprecated alias)Prints the events (changed paths, etc) that have triggered an action to STDERR.
+-v
, --verbose
, -vv
, etcPrints diagnostic and debugging messages to STDERR. Increase the amount of v
s to get progressively more output: for bug reports use three, and for deep debugging four can be helpful.
-V
, --version
Print the version of watchexec.
-h
, --help
Print a help message.
@@ -161,6 +194,8 @@
For this reason, it is not recommended to use Watchexec for watching disparate folders in a filesystem, where those would resolve to a too-broad project origin.
+The project origin can be overridden with the --project-origin
option.
+
ENVIRONMENT
In variables that contain lists of paths, the separator is as for the $PATH
environment variable (a colon, or semicolon on Windows).