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

fix: improve descriptions for --no-open and --no-open-target #3151

Merged
merged 2 commits into from
Apr 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ Options:
--client-progress Print compilation progress in percentage in the browser.
--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 <value...> Open specified browser.
--open-target <value...> Open specified route in browser.
--open [value...] Open the default browser.
--no-open Do not open the default browser.
--open-app <value> Open specified browser.
--open-target [value...] Open specified route in browser.
--no-open-target Do not open specified route in browser.
--client-logging <value> 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.
Expand All @@ -106,6 +108,7 @@ Options:
--public <value> 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 <value...> Watch static files for file changes.
anshumanv marked this conversation as resolved.
Show resolved Hide resolved

Global options:
--color Enable colors on console.
Expand Down
4 changes: 3 additions & 1 deletion bin/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ module.exports = {
},
],
description: 'Open the default browser.',
negatedDescription: 'Do not open the default browser.',
},
{
name: 'open-app',
Expand Down Expand Up @@ -158,6 +159,7 @@ module.exports = {
opts.open.target = opts.openTarget;
delete opts.openTarget;
},
negatedDescription: 'Do not open specified route in browser.',
multiple: true,
},
{
Expand Down Expand Up @@ -236,7 +238,7 @@ module.exports = {
type: 'string',
},
],
description: 'Watch static files for file changes',
description: 'Watch static files for file changes.',
multiple: true,
},
],
Expand Down
18 changes: 18 additions & 0 deletions test/cli/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) => {
Expand Down