Skip to content

Commit 09fa827

Browse files
authored
fix: improve descriptions for --no-open and --no-open-target (#3151)
1 parent dc650e7 commit 09fa827

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

README.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ Options:
9797
--no-client-overlay Do not show a full-screen overlay in the browser when there are compiler errors or warnings.
9898
--setup-exit-signals Close and exit the process on SIGINT and SIGTERM.
9999
--no-setup-exit-signals Do not close and exit the process on SIGNIT and SIGTERM.
100-
--open [value] Open the default browser, or optionally specify a browser name.
101-
--open-app <value...> Open specified browser.
102-
--open-target <value...> Open specified route in browser.
100+
--open [value...] Open the default browser.
101+
--no-open Do not open the default browser.
102+
--open-app <value> Open specified browser.
103+
--open-target [value...] Open specified route in browser.
104+
--no-open-target Do not open specified route in browser.
103105
--client-logging <value> Log level in the browser (none, error, warn, info, log, verbose).
104106
--history-api-fallback Fallback to /index.html for Single Page Applications.
105107
--no-history-api-fallback Do not fallback to /index.html for Single Page Applications.
@@ -108,6 +110,7 @@ Options:
108110
--public <value> The public hostname/ip address of the server.
109111
--firewall [value...] Enable firewall or set hosts that are allowed to access the dev server.
110112
--no-firewall Disable firewall.
113+
--watch-files <value...> Watch static files for file changes.
111114
112115
Global options:
113116
--color Enable colors on console.

bin/cli-flags.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ module.exports = {
143143
},
144144
],
145145
description: 'Open the default browser.',
146+
negatedDescription: 'Do not open the default browser.',
146147
},
147148
{
148149
name: 'open-app',
@@ -176,6 +177,7 @@ module.exports = {
176177
opts.open.target = opts.openTarget;
177178
delete opts.openTarget;
178179
},
180+
negatedDescription: 'Do not open specified route in browser.',
179181
multiple: true,
180182
},
181183
{
@@ -254,7 +256,7 @@ module.exports = {
254256
type: 'string',
255257
},
256258
],
257-
description: 'Watch static files for file changes',
259+
description: 'Watch static files for file changes.',
258260
multiple: true,
259261
},
260262
],

test/cli/cli.test.js

+18
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,15 @@ describe('CLI', () => {
246246
.catch(done);
247247
});
248248

249+
it('--no-open', (done) => {
250+
testBin('--no-open')
251+
.then((output) => {
252+
expect(output.exitCode).toEqual(0);
253+
done();
254+
})
255+
.catch(done);
256+
});
257+
249258
it('--open-app google-chrome', (done) => {
250259
testBin('--open-app google-chrome')
251260
.then((output) => {
@@ -264,6 +273,15 @@ describe('CLI', () => {
264273
.catch(done);
265274
});
266275

276+
it('--no-open-target', (done) => {
277+
testBin('--no-open-target')
278+
.then((output) => {
279+
expect(output.exitCode).toEqual(0);
280+
done();
281+
})
282+
.catch(done);
283+
});
284+
267285
it('--open-target index.html', (done) => {
268286
testBin('--open-target index.html')
269287
.then((output) => {

0 commit comments

Comments
 (0)