Skip to content

Commit

Permalink
Merge pull request #5464 from pascalduez/hotfix/cli-h-shorthand-conflict
Browse files Browse the repository at this point in the history
Workaround the dev cli -h shorthand conflict
  • Loading branch information
ndelangen authored Feb 4, 2019
2 parents 6deb570 + 385b518 commit cf6e494
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/core/src/server/cli/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ async function getCLI(packageJson) {
.option('--no-dll', 'Do not use dll reference')
.parse(process.argv);

// Workaround the `-h` shorthand conflict.
// Output the help if `-h` is called without any value.
// See storybooks/storybook#5360
program.on('option:host', value => {
if (!value) {
program.help();
}
});

logger.info(chalk.bold(`${packageJson.name} v${packageJson.version}`) + chalk.reset('\n'));

// The key is the field created in `program` variable for
Expand Down

0 comments on commit cf6e494

Please sign in to comment.