Skip to content

Commit

Permalink
Fix showing help message on -h
Browse files Browse the repository at this point in the history
  • Loading branch information
th0r committed Apr 10, 2019
1 parent 30786eb commit 0404322
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 0404322

Please sign in to comment.