From 09fa827c0abbce271fa70f3553b004ff64d16b32 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Mon, 5 Apr 2021 17:38:28 +0530 Subject: [PATCH] fix: improve descriptions for `--no-open` and `--no-open-target` (#3151) --- README.md | 9 ++++++--- bin/cli-flags.js | 4 +++- test/cli/cli.test.js | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ec1e83294b..6dc04b67be 100644 --- a/README.md +++ b/README.md @@ -97,9 +97,11 @@ Options: --no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings. --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. - --open [value] Open the default browser, or optionally specify a browser name. - --open-app Open specified browser. - --open-target Open specified route in browser. + --open [value...] Open the default browser. + --no-open Do not open the default browser. + --open-app Open specified browser. + --open-target [value...] Open specified route in browser. + --no-open-target Do not open specified route in browser. --client-logging Log level in the browser (none, error, warn, info, log, verbose). --history-api-fallback Fallback to /index.html for Single Page Applications. --no-history-api-fallback Do not fallback to /index.html for Single Page Applications. @@ -108,6 +110,7 @@ Options: --public The public hostname/ip address of the server. --firewall [value...] Enable firewall or set hosts that are allowed to access the dev server. --no-firewall Disable firewall. + --watch-files Watch static files for file changes. Global options: --color Enable colors on console. diff --git a/bin/cli-flags.js b/bin/cli-flags.js index de180f7229..9382421ed6 100644 --- a/bin/cli-flags.js +++ b/bin/cli-flags.js @@ -143,6 +143,7 @@ module.exports = { }, ], description: 'Open the default browser.', + negatedDescription: 'Do not open the default browser.', }, { name: 'open-app', @@ -176,6 +177,7 @@ module.exports = { opts.open.target = opts.openTarget; delete opts.openTarget; }, + negatedDescription: 'Do not open specified route in browser.', multiple: true, }, { @@ -254,7 +256,7 @@ module.exports = { type: 'string', }, ], - description: 'Watch static files for file changes', + description: 'Watch static files for file changes.', multiple: true, }, ], diff --git a/test/cli/cli.test.js b/test/cli/cli.test.js index adb368c76f..11acb460eb 100644 --- a/test/cli/cli.test.js +++ b/test/cli/cli.test.js @@ -246,6 +246,15 @@ describe('CLI', () => { .catch(done); }); + it('--no-open', (done) => { + testBin('--no-open') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + it('--open-app google-chrome', (done) => { testBin('--open-app google-chrome') .then((output) => { @@ -264,6 +273,15 @@ describe('CLI', () => { .catch(done); }); + it('--no-open-target', (done) => { + testBin('--no-open-target') + .then((output) => { + expect(output.exitCode).toEqual(0); + done(); + }) + .catch(done); + }); + it('--open-target index.html', (done) => { testBin('--open-target index.html') .then((output) => {