From 6cfe649228d903bb086a6323339c4df651c2ceb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Sun, 11 Apr 2021 02:51:20 +1200 Subject: [PATCH] Document --shell --- README.md | 2 +- completions/zsh | 4 +++- doc/watchexec.1.ronn | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 22eecf4..30021a9 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Call/restart `my_server` when any file in the current directory (and all subdire $ watchexec -r -s SIGKILL my_server -Send a SIGHUP to the child process upon changes (Note: with using `-n | --no-shell` here, we're executing `my_server` directly, instead of wrapping it in a shell: +Send a SIGHUP to the child process upon changes (Note: using `-n` here we're executing `my_server` directly, instead of wrapping it in a shell: $ watchexec -n -s SIGHUP my_server diff --git a/completions/zsh b/completions/zsh index 3139f40..7265c3b 100644 --- a/completions/zsh +++ b/completions/zsh @@ -11,7 +11,9 @@ cmd="$words[1]" args=( '(-c --clear)'{-c,--clear}'[Clear screen before executing command]' '(-h --help)'{-h,--help}'[Prints help information]' - '(-n --no-shell)'{-n,--no-shell}'[Do not wrap command in ''sh -c'' resp. ''cmd.exe /C'']' + '--shell=[Change the wrapping shell, or `none` to disable]' + '--no-shell[Deprecated, use --shell=none]' + '-n[Shorthand for --shell=none]' '--no-environment[Do not set WATCHEXEC_*_PATH environment variables for child process]' '--no-meta[Ignore metadata changes]' '(-p --postpone)'{-p,--postpone}'[Wait until first change to execute command]' diff --git a/doc/watchexec.1.ronn b/doc/watchexec.1.ronn index 44a8536..39943e7 100644 --- a/doc/watchexec.1.ronn +++ b/doc/watchexec.1.ronn @@ -25,8 +25,18 @@ Ignores modifications from paths that do not match . This option can be * `-s`, `--signal`: Sends the specified signal (e.g. `SIGKILL`) to the child process. Defaults to `SIGTERM`. -* `-n`, `--no-shell`: -Execute command directly, do not wrap it in `sh -c` resp. `cmd.exe /C`. This is especially useful in combination with `--signal`, as the signal is then send directly to the specified command. While `--no-shell` is a little more performant than the default, it prevents using shell-features like pipes and redirects. +* `--shell` : +Change the shell used to run the command. Set to `none` to run the command directly without a shell. + +The special value `powershell` will use Microsoft Powershell's calling convention, otherwise `SHELL -c COMMAND`. + +The `none` value is especially useful in combination with `--signal`, as the signal is then send directly to the specified command. While `--shell=none` is a little more performant than the default, it prevents using shell-features like pipes and redirects. + +* `--no-shell`: +Deprecated. Alias for `--shell=none`. + +* `-n`: +Shorthand for `--shell=none`. * `--no-meta`: Ignore metadata changes.