Skip to content

Commit

Permalink
feat: output help information on unknown CLI commands (#857)
Browse files Browse the repository at this point in the history
close #849
  • Loading branch information
hsxfjames authored and yyx990803 committed Feb 28, 2018
1 parent 73ad2f8 commit cd23858
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/@vue/cli/bin/vue.js
Expand Up @@ -87,6 +87,15 @@ program
loadCommand('init', '@vue/cli-init')
})

// output help information on unknown commands
program
.arguments('<command>')
.action((cmd) => {
program.outputHelp()
console.log(` ` + chalk.red(`Unknown command ${chalk.yellow(cmd)}.`))
console.log()
})

// add some useful info on help
program.on('--help', () => {
console.log()
Expand Down

0 comments on commit cd23858

Please sign in to comment.