Skip to content

Commit cd23858

Browse files
hsxfjamesyyx990803
authored andcommitted
feat: output help information on unknown CLI commands (#857)
close #849
1 parent 73ad2f8 commit cd23858

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/@vue/cli/bin/vue.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ program
8787
loadCommand('init', '@vue/cli-init')
8888
})
8989

90+
// output help information on unknown commands
91+
program
92+
.arguments('<command>')
93+
.action((cmd) => {
94+
program.outputHelp()
95+
console.log(` ` + chalk.red(`Unknown command ${chalk.yellow(cmd)}.`))
96+
console.log()
97+
})
98+
9099
// add some useful info on help
91100
program.on('--help', () => {
92101
console.log()

0 commit comments

Comments
 (0)