mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 21:11:07 +08:00
Merge pull request #12799 from storybookjs/refactor/leverage-arg-parser
CLI: Clean up handling of unknown subcommands
This commit is contained in:
commit
68f6e2c9b4
@ -89,8 +89,7 @@ program
|
||||
})
|
||||
);
|
||||
|
||||
program.command('*', { noHelp: true }).action(() => {
|
||||
const [, , invalidCmd] = process.argv;
|
||||
program.on('command:*', ([invalidCmd]) => {
|
||||
logger.error(' Invalid command: %s.\n See --help for a list of available commands.', invalidCmd);
|
||||
// eslint-disable-next-line
|
||||
const availableCommands = program.commands.map((cmd) => cmd._name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user