Document dropped --watch option

This commit is contained in:
Matt Green 2016-11-17 08:46:23 -05:00
parent f768721ca3
commit 98c2698798
5 changed files with 151 additions and 26 deletions

View File

@ -15,7 +15,7 @@ test:
@cargo test
doc: doc/watchexec.1.ronn
@ronn --roff doc/watchexec.1.ronn
@ronn doc/watchexec.1.ronn
install: release
@cp target/release/watchexec /usr/bin

View File

@ -17,7 +17,7 @@ Example use cases:
* Simple invocation and use
* Runs on OS X, Linux and Windows
* Monitors current directory and all subdirectories for changes (use `--watch` to override)
* Monitors current directory and all subdirectories for changes
* Uses most efficient event polling mechanism for your platform (except for [BSD](https://github.com/passcod/rsnotify#todo))
* Coalesces multiple filesystem events into one, for editors that use swap/backup files during saving
* By default, uses `.gitignore` to determine which files to ignore notifications for
@ -42,10 +42,6 @@ Watch all JavaScript, CSS and HTML files in the current directory and all subdir
$ watchexec --exts js,css,html make
Watch all files below `src` and subdirectories for changes, running `make test` when a change is detected:
$ watchexec --watch src make test
Call `make test` when any file changes in this directory/subdirectory, except for everything below `target`:
$ watchexec -i target make test

View File

@ -1,16 +1,16 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "WATCHEXEC" "1" "October 2016" "" ""
.TH "WATCHEXEC" "1" "November 2016" "" ""
.
.SH "NAME"
\fBwatchexec\fR \- execute commands when watched files change
.
.SH "SYNOPSIS"
watchexec [\fB\-\-watch\fR | \fB\-w\fR \fIpath\fR] [\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] \fIcommand\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\-\-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\.\.\.]
.
.SH "DESCRIPTION"
Recursively monitors directories for changes, executing the command when a filesystem change (add/modify/delete) is detected\. By default, watchexec uses efficient kernel\-level mechanisms to watch for changes\.
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\.
.
.P
At startup, the specified \fIcommand\fR (passing any supplied \fIargument\fRs) is run once, and watchexec begins monitoring for changes\.
@ -18,12 +18,8 @@ At startup, the specified \fIcommand\fR (passing any supplied \fIargument\fRs) i
.SH "OPTIONS"
.
.TP
\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\-w\fR, \fB\-\-watch\fR \fIpath\fR
Specifies the path to watch\. This argument can be specified multiple times, with all paths being watched simultaneously\. Defaults to current directory\.
\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\.
.
.TP
\fB\-e\fR, \fB\-\-exts\fR \fIextensions\fR
@ -39,7 +35,7 @@ Ignores modifications from paths that match \fIpattern\fR\. This option can be s
.
.TP
\fB\-r\fR, \fB\-\-restart\fR
Sends SIGTERM to the child process if it is still running when subsequent file modifications are detected, then waits for the child to exit\.
Sends \fBSIGTERM\fR to the child process if it is still running when subsequent file modifications are detected, then waits for the child to exit\.
.
.TP
\fB\-c\fR, \fB\-\-clear\fR
@ -55,7 +51,7 @@ Prints diagnostic messages to STDERR
.
.TP
\fB\-\-force\-poll\fR \fIinterval\fR
When watching directories, 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\.
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\-\-no\-vcs\-ignore\fR

136
doc/watchexec.1.html Normal file
View File

@ -0,0 +1,136 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='content-type' value='text/html;charset=utf8'>
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
<title>watchexec(1) - execute commands when watched files change</title>
<style type='text/css' media='all'>
/* style: man */
body#manpage {margin:0}
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
.mp h2 {margin:10px 0 0 0}
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
.mp h3 {margin:0 0 0 4ex}
.mp dt {margin:0;clear:left}
.mp dt.flush {float:left;width:8ex}
.mp dd {margin:0 0 0 9ex}
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
.mp pre {margin-bottom:20px}
.mp pre+h2,.mp pre+h3 {margin-top:22px}
.mp h2+pre,.mp h3+pre {margin-top:5px}
.mp img {display:block;margin:auto}
.mp h1.man-title {display:none}
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
.mp h2 {font-size:16px;line-height:1.25}
.mp h1 {font-size:20px;line-height:2}
.mp {text-align:justify;background:#fff}
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
.mp u {text-decoration:underline}
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
.mp b.man-ref {font-weight:normal;color:#434241}
.mp pre {padding:0 4ex}
.mp pre code {font-weight:normal;color:#434241}
.mp h2+pre,h3+pre {padding-left:0}
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
ol.man-decor {width:100%}
ol.man-decor li.tl {text-align:left}
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
ol.man-decor li.tr {text-align:right;float:right}
</style>
</head>
<!--
The following styles are deprecated and will be removed at some point:
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
.man-navigation should be used instead.
-->
<body id='manpage'>
<div class='mp' id='man'>
<div class='man-navigation' style='display:none'>
<a href="#NAME">NAME</a>
<a href="#SYNOPSIS">SYNOPSIS</a>
<a href="#DESCRIPTION">DESCRIPTION</a>
<a href="#OPTIONS">OPTIONS</a>
<a href="#ENVIRONMENT">ENVIRONMENT</a>
<a href="#EXAMPLES">EXAMPLES</a>
</div>
<ol class='man-decor man-head man head'>
<li class='tl'>watchexec(1)</li>
<li class='tc'></li>
<li class='tr'>watchexec(1)</li>
</ol>
<h2 id="NAME">NAME</h2>
<p class="man-name">
<code>watchexec</code> - <span class="man-whatis">execute commands when watched files change</span>
</p>
<h2 id="SYNOPSIS">SYNOPSIS</h2>
<p>watchexec [<code>--exts</code> | <code>-e</code> <var>extensions</var>]... [<code>--filter</code> | <code>-f</code> <var>pattern</var>]... [<code>--ignore</code> | <code>-i</code> <var>pattern</var>]... [<code>--restart</code> | <code>-r</code>] [<code>--clear</code> | <code>-c</code>] [<code>--postpone</code> | <code>-p</code>] [<code>--force-poll</code> <var>interval</var>] [<code>--debug</code> | <code>-d</code>] [<code>--no-vcs-ignore</code>] <var>cmd</var> [<var>argument</var>...]</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
<p>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.</p>
<p>At startup, the specified <var>command</var> (passing any supplied <var>argument</var>s) is run once, and watchexec begins monitoring for changes.</p>
<h2 id="OPTIONS">OPTIONS</h2>
<dl>
<dt class="flush"><var>cmd</var></dt><dd><p>Command to run when watched files are modified, and at startup, unless <code>--postpone</code> is specified. All <var>argument</var>s are passed to <var>cmd</var>.</p></dd>
<dt><code>-e</code>, <code>--exts</code> <var>extensions</var></dt><dd><p>Comma-separated list of file extensions to filter by. Leading dots are allowed (.rs) are allowed. (This is a shorthand for <code>-f</code>).</p></dd>
<dt><code>-f</code>, <code>--filter</code> <var>pattern</var></dt><dd><p>Ignores modifications from paths that do not match <var>pattern</var>. This option can be specified multiple times, where a match on any given pattern causes the path to trigger <em>command</em>.</p></dd>
<dt><code>-i</code>, <code>--ignore</code> <em>pattern</em></dt><dd><p>Ignores modifications from paths that match <var>pattern</var>. This option can be specified multiple times, and a match on any pattern causes the path to be ignored.</p></dd>
<dt><code>-r</code>, <code>--restart</code></dt><dd><p>Sends <code>SIGTERM</code> to the child process if it is still running when subsequent file modifications are detected, then waits for the child to exit.</p></dd>
<dt><code>-c</code>, <code>--clear</code></dt><dd><p>Clears the screen before executing <var>command</var>.</p></dd>
<dt><code>-p</code>, <code>--postpone</code></dt><dd><p>Postpone execution of <var>command</var> until the first file modification is detected.</p></dd>
<dt><code>-d</code>, <code>--debug</code></dt><dd><p>Prints diagnostic messages to STDERR</p></dd>
<dt><code>--force-poll</code> <var>interval</var></dt><dd><p>Poll for changes every <var>interval</var> ms instead of using system-specific notification mechanisms (such as inotify). This is useful when you are monitoring NFS shares.</p></dd>
<dt><code>--no-vcs-ignore</code></dt><dd><p>Skip loading of version control system (VCS) ignore files. By default, watchexec loads .gitignore files in the current directory (or parent directories) and uses them to populate the ignore list.</p></dd>
</dl>
<h2 id="ENVIRONMENT">ENVIRONMENT</h2>
<p>Processes started by watchexec have the <code>$WATCHEXEC_UPDATED_PATH</code> environment variable set to the path of the first modification observed. In addition, the <code>$WATCHEXEC_COMMON_PATH</code> environment variable is set to the common path of all observed modifications.</p>
<h2 id="EXAMPLES">EXAMPLES</h2>
<p>Rebuild a project when source files change:</p>
<pre><code>$ watchexec make
</code></pre>
<p>Watch all HTML, CSS, and JavaScript files for changes:</p>
<pre><code>$ watchexec -e html,css,js make
</code></pre>
<p>Run tests when source files change, clearing the screen each time:</p>
<pre><code>$ watchexec -c make test
</code></pre>
<p>Launch and restart a node.js server</p>
<pre><code>$ watchexec -r node app.js
</code></pre>
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>November 2016</li>
<li class='tr'>watchexec(1)</li>
</ol>
</div>
</body>
</html>

View File

@ -3,21 +3,18 @@ watchexec(1) -- execute commands when watched files change
## SYNOPSIS
watchexec [`--watch` | `-w` <path>] [`--exts` | `-e` <extensions>]... [`--filter` | `-f` <pattern>]... [`--ignore` | `-i` <pattern>]... [`--restart` | `-r`] [`--clear` | `-c`] [`--postpone` | `-p`] [`--force-poll` <interval>] [`--debug` | `-d`] [`--no-vcs-ignore`] <command> [<argument>...]
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>...]
## DESCRIPTION
Recursively monitors directories for changes, executing the command when a filesystem change (add/modify/delete) is detected. By default, watchexec uses efficient kernel-level mechanisms to watch for changes.
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.
At startup, the specified <command> (passing any supplied <argument>s) is run once, and watchexec begins monitoring for changes.
## OPTIONS
* <command>:
Command to run when watched files are modified, and at startup, unless `--postpone` is specified. All <argument>s are passed to <command>.
* `-w`, `--watch` <path>:
Specifies the path to watch. This argument can be specified multiple times, with all paths being watched simultaneously. Defaults to current directory.
* <cmd>:
Command to run when watched files are modified, and at startup, unless `--postpone` is specified. All <argument>s are passed to <cmd>.
* `-e`, `--exts` <extensions>:
Comma-separated list of file extensions to filter by. Leading dots are allowed (.rs) are allowed. (This is a shorthand for `-f`).
@ -29,7 +26,7 @@ Ignores modifications from paths that do not match <pattern>. This option can be
Ignores 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.
* `-r`, `--restart`:
Sends SIGTERM to the child process if it is still running when subsequent file modifications are detected, then waits for the child to exit.
Sends `SIGTERM` to the child process if it is still running when subsequent file modifications are detected, then waits for the child to exit.
* `-c`, `--clear`:
Clears the screen before executing <command>.
@ -41,7 +38,7 @@ Postpone execution of <command> until the first file modification is detected.
Prints diagnostic messages to STDERR
* `--force-poll` <interval>:
When watching directories, poll for changes every <interval> ms instead of using system-specific notification mechanisms (such as inotify). This is useful when you are monitoring NFS shares.
Poll for changes every <interval> ms instead of using system-specific notification mechanisms (such as inotify). This is useful when you are monitoring NFS shares.
* `--no-vcs-ignore`:
Skip loading of version control system (VCS) ignore files. By default, watchexec loads .gitignore files in the current directory (or parent directories) and uses them to populate the ignore list.