Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add -w option as an alias to --watch #51696

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -2286,7 +2286,7 @@ added: v0.1.3

Print node's version.

### `--watch`
### `-w`, `--watch`

<!-- YAML
added:
Expand All @@ -2298,6 +2298,10 @@ changes:
- v18.13.0
pr-url: https://github.com/nodejs/node/pull/45214
description: Test runner now supports running in watch mode.
- version:
- REPLACEME
pr-url: https://github.com/nodejs/node/pull/51696
description: With this pull request, node -w also will be activate watch mode alongside node --watch.
-->

> Stability: 1 - Experimental
Expand Down Expand Up @@ -2593,7 +2597,7 @@ Node.js options that are allowed are:
* `--v8-pool-size`
* `--watch-path`
* `--watch-preserve-output`
* `--watch`
* `--watch`, `-w`
* `--zero-fill-buffers`

<!-- node-options-node end -->
Expand Down
1 change: 1 addition & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -706,6 +706,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
"run in watch mode",
&EnvironmentOptions::watch_mode,
kAllowedInEnvvar);
AddAlias("-w", "--watch");
AddOption("--watch-path",
"path to watch",
&EnvironmentOptions::watch_mode_paths,
Expand Down