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 showing help message on -h #260

Merged
merged 1 commit into from Apr 10, 2019
Merged
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
6 changes: 4 additions & 2 deletions src/bin/analyzer.js
Expand Up @@ -32,7 +32,9 @@ const program = commander
'server'
)
.option(
'-h, --host <host>',
// Had to make `host` parameter optional in order to let `-h` flag output help message
// Fixes https://github.com/webpack-contrib/webpack-bundle-analyzer/issues/239
'-h, --host [host]',
'Host that will be used in `server` mode to start HTTP server.',
'127.0.0.1'
)
Expand Down Expand Up @@ -125,7 +127,7 @@ if (mode === 'server') {
}

function showHelp(error) {
if (error) console.log(`\n ${magenta(error)}`);
if (error) console.log(`\n ${magenta(error)}\n`);
program.outputHelp();
process.exit(1);
}
Expand Down