diff --git a/README.md b/README.md index 4fda81d9..436f97b0 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,10 @@ Run `make` when any file changes, using the `.gitignore` file in the current dir $ watchexec make +Run `make` when any file in `lib` or `src` changes: + + $ watchexec -w lib -w src make + ##Installation ###Cargo diff --git a/doc/watchexec.1 b/doc/watchexec.1 index 1450ca15..ac2c7eb5 100644 --- a/doc/watchexec.1 +++ b/doc/watchexec.1 @@ -1,13 +1,13 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "WATCHEXEC" "1" "December 2016" "" "" +.TH "WATCHEXEC" "1" "February 2017" "" "" . .SH "NAME" \fBwatchexec\fR \- execute commands when watched files change . .SH "SYNOPSIS" -watchexec [\fB\-\-exts\fR | \fB\-e\fR \fIextensions\fR]\.\.\. [\fB\-\-filter\fR | \fB\-f\fR \fIpattern\fR]\.\.\. [\fB\-\-ignore\fR | \fB\-i\fR \fIpattern\fR]\.\.\. [\fB\-\-restart\fR | \fB\-r\fR] [\fB\-\-clear\fR | \fB\-c\fR] [\fB\-\-postpone\fR | \fB\-p\fR] [\fB\-\-force\-poll\fR \fIinterval\fR] [\fB\-\-debug\fR | \fB\-d\fR] [\fB\-\-no\-vcs\-ignore\fR] \fIcmd\fR [\fIargument\fR\.\.\.] +watchexec [\fB\-\-exts\fR | \fB\-e\fR \fIextensions\fR]\.\.\. [\fB\-\-filter\fR | \fB\-f\fR \fIpattern\fR]\.\.\. [\fB\-\-ignore\fR | \fB\-i\fR \fIpattern\fR]\.\.\. [\fB\-\-watch\fR | \fB\-w\fR \fIpath\fR]\.\.\. [\fB\-\-restart\fR | \fB\-r\fR] [\fB\-\-clear\fR | \fB\-c\fR] [\fB\-\-postpone\fR | \fB\-p\fR] [\fB\-\-force\-poll\fR \fIinterval\fR] [\fB\-\-debug\fR | \fB\-d\fR] [\fB\-\-no\-vcs\-ignore\fR] \fIcommand\fR [\fIargument\fR\.\.\.] . .SH "DESCRIPTION" Recursively monitors the current directory for changes, executing the command when a filesystem change is detected\. By default, watchexec uses efficient kernel\-level mechanisms to watch for changes\. @@ -18,8 +18,8 @@ At startup, the specified \fIcommand\fR (passing any supplied \fIargument\fRs) i .SH "OPTIONS" . .TP -\fIcmd\fR -Command to run when watched files are modified, and at startup, unless \fB\-\-postpone\fR is specified\. All \fIargument\fRs are passed to \fIcmd\fR\. +\fIcommand\fR +Command to run when watched files are modified, and at startup, unless \fB\-\-postpone\fR is specified\. All \fIargument\fRs are passed to \fIcommand\fR\. . .TP \fB\-e\fR, \fB\-\-exts\fR \fIextensions\fR @@ -38,6 +38,10 @@ Send \fBSIGKILL\fR to the child process group instead of \fBSIGTERM\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 child process group if it is still running when subsequent file modifications are detected\. By default, sends \fBSIGTERM\fR; use \fB\-\-kill\fR to send \fBSIGKILL\fR\. . @@ -104,7 +108,7 @@ $ watchexec \-c make test .IP "" 0 . .P -Launch and restart a node\.js server +Launch and restart a node\.js server: . .IP "" 4 . @@ -115,4 +119,17 @@ $ watchexec \-r node app\.js .fi . .IP "" 0 +. +.P +Watch lib and src directories for changes, rebuilding each time: +. +.IP "" 4 +. +.nf + +$ watchexec \-w lib \-w src make +. +.fi +. +.IP "" 0 diff --git a/doc/watchexec.1.html b/doc/watchexec.1.html index e077623f..ed03541c 100644 --- a/doc/watchexec.1.html +++ b/doc/watchexec.1.html @@ -74,7 +74,7 @@
watchexec [--exts
| -e
extensions]... [--filter
| -f
pattern]... [--ignore
| -i
pattern]... [--restart
| -r
] [--clear
| -c
] [--postpone
| -p
] [--force-poll
interval] [--debug
| -d
] [--no-vcs-ignore
] cmd [argument...]
watchexec [--exts
| -e
extensions]... [--filter
| -f
pattern]... [--ignore
| -i
pattern]... [--watch
| -w
path]... [--restart
| -r
] [--clear
| -c
] [--postpone
| -p
] [--force-poll
interval] [--debug
| -d
] [--no-vcs-ignore
] command [argument...]
Command to run when watched files are modified, and at startup, unless --postpone
is specified. All arguments are passed to cmd.
Command to run when watched files are modified, and at startup, unless --postpone
is specified. All arguments are passed to command.
-e
, --exts
extensionsComma-separated list of file extensions to filter by. Leading dots are allowed (.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.
-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.
-k
, --kill
Send SIGKILL
to the child process group instead of SIGTERM
.
-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.
-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.
-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.
-r
, --restart
Terminates the child process group if it is still running when subsequent file modifications are detected. By default, sends SIGTERM
; use --kill
to send SIGKILL
.
-c
, --clear
Clears the screen before executing command.
-p
, --postpone
Postpone execution of command until the first file modification is detected.
$ watchexec -c make test
-Launch and restart a node.js server
+Launch and restart a node.js server:
$ watchexec -r node app.js
+Watch lib and src directories for changes, rebuilding each time:
+ +$ watchexec -w lib -w src make
+
+