From c58d66bec57e5fb8497f7f397b6649b1ad9b358a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Fri, 15 Apr 2022 15:47:44 +1200 Subject: [PATCH] Link manpage from readme --- README.md | 5 +- doc/watchexec.1 | 156 +++++++++++++++++++++++++------------------ doc/watchexec.1.html | 71 +++++++++++++++----- 3 files changed, 148 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 470f811..999ba4b 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,6 @@ Call/restart `python server.py` when any Python file in the current directory (a More usage examples: [in the CLI README](./cli/#usage-examples)! - ## Install Packaging status @@ -47,7 +46,9 @@ More usage examples: [in the CLI README](./cli/#usage-examples)! - From source with Cargo: `cargo install watchexec-cli` - From binary with Binstall: `cargo binstall watchexec-cli` -All options in detail: [in the CLI README](./cli/#installation). +All options in detail: [in the CLI README](./cli/#installation) +and [in the manual page](./doc/watchexec.1.ronn). + ## Augment diff --git a/doc/watchexec.1 b/doc/watchexec.1 index af954f0..82cf336 100644 --- a/doc/watchexec.1 +++ b/doc/watchexec.1 @@ -7,7 +7,7 @@ \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\-\-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\-\-debounce\fR | \fB\-d\fR \fIinterval\fR] [\fB\-\-no\-vcs\-ignore\fR] [\fB\-\-no\-default\-ignore\fR] [\fB\-\-verbose\fR | \fB\-v\fR | \fB\-vv\fR | \fB\-vvv\fR | \fB\-vvvv\fR] [\fB\-\-changes\-only\fR] [\fB\-\-version\fR | \fB\-V\fR] [\-\-] \fIcommand\fR [\fIargument\fR\.\.\.] +watchexec [OPTIONS] [\-\-] \fIcommand\fR [\fIargument\fR\.\.\.] watchexec \-V|\-\-version watchexec [\-h|\-\-help] . .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\. @@ -17,6 +17,8 @@ At startup, the specified \fIcommand\fR (passing any supplied \fIargument\fRs) i . .SH "OPTIONS" . +.SS "Command 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\. If you pass flags to the command, you should separate it with \fB\-\-\fR, for example: \fBwatchexec \-w src \-\- rsync \-a src dest\fR\. @@ -25,16 +27,24 @@ Command to run when watched files are modified, and at startup, unless \fB\-\-po Behaviour depends on the value of \fB\-\-shell\fR: for all except \fBnone\fR, every part of \fIcommand\fR is joined together into one string with a single ascii space character, and given to the shell as described\. For \fBnone\fR, each distinct element of \fIcommand\fR is passed as per the execvp(3) convention: first argument is the program, as a file or searched in the \fBPATH\fR, rest are arguments\. . .TP -\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)\. +\fB\-E\fR, \fB\-\-env\fR \fIkey=value pair\fR +Set additional environment variables on the command (not to Watchexec itself)\. Can be given multiple times (one per variable to set)\. . .TP -\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\. +\fB\-n\fR +Shorthand for \fB\-\-shell=none\fR\. . .TP -\fB\-s\fR, \fB\-\-signal\fR -Sends the specified signal (e\.g\. \fBSIGKILL\fR) to the command\. Defaults to \fBSIGTERM\fR\. +\fB\-\-no\-process\-group\fR +Do not use a process group when running \fIcommand\fR\. +. +.TP +\fB\-\-no\-environment\fR +Do not set WATCHEXEC\fI*\fRPATH environment variables for the command\. +. +.TP +\fB\-\-no\-shell\fR +Deprecated\. Alias for \fB\-\-shell=none\fR\. . .TP \fB\-\-shell\fR \fIshell\fR @@ -56,69 +66,24 @@ If not a special value, the string provided may contain arguments to the shell a See the \fIEXAMPLES\fR for uses of each of these\. . .TP -\fB\-\-no\-shell\fR -Deprecated\. Alias for \fB\-\-shell=none\fR\. +\fB\-\-workdir \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 extensions

Comma-separated list of file extensions to filter by. Leading dots (.rs) are allowed. (This is a shorthand for -f).

-
-f, --filter pattern

Ignores 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 pair

Set 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 shell

Change 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 extensions

Comma-separated list of file extensions to filter by. Leading dots (.rs) are allowed. (This is a shorthand for -f).

+
-f, --filter pattern

Ignores 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 pattern

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.

+
--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 path

Overrides the project origin, where ignore files are resolved from (see PATHS section below).

-w, --watch path

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 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 interval

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.

+
-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 interval

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.

-
-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, etc

Prints diagnostic and debugging messages to STDERR. Increase the amount of vs 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, etc

Prints diagnostic and debugging messages to STDERR. Increase the amount of vs 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).