Skip to content

Commit

Permalink
Merge pull request #260 from webpack-contrib/fix-help-command
Browse files Browse the repository at this point in the history
Fix showing help message on `-h`
  • Loading branch information
th0r committed Apr 10, 2019
2 parents 30786eb + 0404322 commit 5f80d17
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 5f80d17

Please sign in to comment.