From 2e2190a4c54ddebafc729857e5650772635a50ec Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Fri, 19 Feb 2021 17:04:53 +0530 Subject: [PATCH] fix: improve descriptions for negative flags (#3029) --- README.md | 40 +++++++++++++++++++++------------------- bin/cli-flags.js | 3 +++ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index a4b67f3c31..f949eeccf9 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,8 @@ node_modules/.bin/webpack serve Following options are available with `webpack serve`: ``` +Usage: webpack serve|s [entries...] [options] + Options: -c, --config Provide path to a webpack configuration file e.g. ./webpack.config.js. --config-name Name of the configuration to use. @@ -79,28 +81,28 @@ Options: -t, --target Sets the build target e.g. node. --watch-options-stdin Stop watching when stdin stream has ended. --no-watch-options-stdin Do not stop watching when stdin stream has ended. - --host The hostname/ip address the server will bind to - --port The port + --host The hostname/ip address the server will bind to. + --port The port server will listen to. --static [value...] A directory to serve static content from. --no-static Negative 'static' option. - --live-reload Enables/Disables live reloading on changing files - --no-live-reload Negative 'live-reload' option. - --https HTTPS - --http2 HTTP/2, must be used with HTTPS - --bonjour Broadcasts the server via ZeroConf networking on start - --client-progress Print compilation progress in percentage in the browser - --hot-only Do not refresh page if HMR fails - --setup-exit-signals Close and exit the process on SIGINT and SIGTERM - --no-setup-exit-signals Negative 'setup-exit-signals' option. - --stdin Close when stdin ends - --open [value] Open the default browser, or optionally specify a browser name - --use-local-ip Open default browser with local IP - --open-page Open default browser with the specified page - --client-logging Log level in the browser (none, error, warn, info, log, verbose) + --live-reload Enables live reloading on changing files. + --no-live-reload Disables live reloading on changing files. + --https Use HTTPS protocol. + --http2 Use HTTP/2, must be used with HTTPS. + --bonjour Broadcasts the server via ZeroConf networking on start. + --client-progress Print compilation progress in percentage in the browser. + --hot-only Do not refresh page if HMR fails. + --setup-exit-signals Close and exit the process on SIGINT and SIGTERM. + --no-setup-exit-signals Do not close and exit the process on SIGNIT and SIGTERM. + --stdin Close when stdin ends. + --open [value] Open the default browser, or optionally specify a browser name. + --use-local-ip Open default browser with local IP. + --open-page Open default browser with the specified page. + --client-logging Log level in the browser (none, error, warn, info, log, verbose). --history-api-fallback Fallback to /index.html for Single Page Applications. - --compress Enable gzip compression - --public The public hostname/ip address of the server - --firewall Enable/disable firewall, or set hosts that are allowed to access the dev server + --compress Enable gzip compression. + --public The public hostname/ip address of the server. + --firewall Enable/disable firewall, or set hosts that are allowed to access the dev server. Global options: --color Enable colors on console. diff --git a/bin/cli-flags.js b/bin/cli-flags.js index 7b40966b56..8465bca32e 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -23,6 +23,7 @@ module.exports = { name: 'live-reload', type: Boolean, description: 'Enables live reloading on changing files.', + negatedDescription: 'Disables live reloading on changing files.', negative: true, }, { @@ -63,6 +64,8 @@ module.exports = { name: 'setup-exit-signals', type: Boolean, description: 'Close and exit the process on SIGINT and SIGTERM.', + negatedDescription: + 'Do not close and exit the process on SIGNIT and SIGTERM.', negative: true, }, {