diff --git a/cli/src/args.rs b/cli/src/args.rs index 739a886..f3367d5 100644 --- a/cli/src/args.rs +++ b/cli/src/args.rs @@ -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") { diff --git a/cli/tests/snapshots/help__help_unix.snap b/cli/tests/snapshots/help__help_unix.snap index a0c4baa..86cd2c6 100644 --- a/cli/tests/snapshots/help__help_unix.snap +++ b/cli/tests/snapshots/help__help_unix.snap @@ -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). + diff --git a/cli/tests/snapshots/help__help_windows.snap b/cli/tests/snapshots/help__help_windows.snap index 5385fd2..5925c4b 100644 --- a/cli/tests/snapshots/help__help_windows.snap +++ b/cli/tests/snapshots/help__help_windows.snap @@ -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 diff --git a/doc/watchexec.1 b/doc/watchexec.1 index f32ad69..57a6dd6 100644 --- a/doc/watchexec.1 +++ b/doc/watchexec.1 @@ -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\. . diff --git a/doc/watchexec.1.html b/doc/watchexec.1.html index 8e92e8c..7b9b223 100644 --- a/doc/watchexec.1.html +++ b/doc/watchexec.1.html @@ -130,6 +130,7 @@
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.
-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.