Add --no-process-group flag

This commit is contained in:
Félix Saparelli 2021-07-22 00:56:35 +12:00
parent ef36d3429d
commit 66caedf978
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474
6 changed files with 17 additions and 2 deletions

View File

@ -126,6 +126,9 @@ pub fn get_args() -> Result<(Config, LevelFilter)> {
.arg(Arg::with_name("no-environment")
.help("Do not set WATCHEXEC_*_PATH environment variables for the command")
.long("no-environment"))
.arg(Arg::with_name("no-process-group")
.help("Do not use a process group when running the command")
.long("no-process-group"))
.arg(Arg::with_name("once").short("1").hidden(true))
.arg(Arg::with_name("watch-when-idle")
.help("Deprecated alias for --on-busy-update=do-nothing, which will become the default in 2.0.")
@ -263,6 +266,7 @@ pub fn get_args() -> Result<(Config, LevelFilter)> {
builder.no_vcs_ignore(args.is_present("no-vcs-ignore"));
builder.no_ignore(args.is_present("no-ignore"));
builder.poll(args.occurrences_of("poll") > 0);
builder.use_process_group(!args.is_present("no-process-group"));
let mut config = builder.build()?;
if args.is_present("once") {

View File

@ -17,6 +17,7 @@ FLAGS:
--no-environment Do not set WATCHEXEC_*_PATH environment variables for the command
--no-ignore Skip auto-loading of ignore files (.gitignore, .ignore, etc.) for filtering
--no-meta Ignore metadata changes
--no-process-group Do not use a process group when running the command
-n, --no-shell Do not wrap command in a shell. Deprecated: use --shell=none instead.
--no-vcs-ignore Skip auto-loading of .gitignore files for filtering
-p, --postpone Wait until first change to execute command
@ -44,3 +45,4 @@ ARGS:
Use @argfile as first argument to load arguments from the file `argfile` (one argument per line) which will be inserted
in place of the @argfile (further arguments on the CLI will override or add onto those in the file).

View File

@ -17,6 +17,7 @@ FLAGS:
--no-environment Do not set WATCHEXEC_*_PATH environment variables for the command
--no-ignore Skip auto-loading of ignore files (.gitignore, .ignore, etc.) for filtering
--no-meta Ignore metadata changes
--no-process-group Do not use a process group when running the command
-n, --no-shell Do not wrap command in a shell. Deprecated: use --shell=none instead.
--no-vcs-ignore Skip auto-loading of .gitignore files for filtering
-p, --postpone Wait until first change to execute command

View File

@ -1,7 +1,7 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "WATCHEXEC" "1" "April 2021" "" ""
.TH "WATCHEXEC" "1" "July 2021" "" ""
.
.SH "NAME"
\fBwatchexec\fR \- execute commands when watched files change
@ -91,6 +91,10 @@ Ignore events while the process is still running\. This is distinct from \fB\-\-
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\.
.

View File

@ -130,6 +130,7 @@
<p>This behaviour will become the default in v2.0.</p>
<dl>
<dt><code>--no-process-group</code></dt><dd><p>Do not use a process group when running <var>command</var>.</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>--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>
@ -220,7 +221,7 @@
<ol class='man-decor man-foot man foot'>
<li class='tl'></li>
<li class='tc'>April 2021</li>
<li class='tc'>July 2021</li>
<li class='tr'>watchexec(1)</li>
</ol>

View File

@ -66,6 +66,9 @@ Ignore events while the process is still running. This is distinct from `--resta
This behaviour will become the default in v2.0.
* `--no-process-group`:
Do not use a process group when running <command>.
* `-c`, `--clear`:
Clears the screen before executing <command>.