Skip to content

Commit

Permalink
refactor: show help for unknown commands
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Nov 1, 2021
1 parent ff551cf commit fb0ea54
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ module.exports = () => {

program
.storeOptionsAsProperties(false)
.showSuggestionAfterError()
.showHelpAfterError()
.option('-v, --version', 'output current framework and CLI versions')
.on('option:version', () => {
const pkg = require('../package.json')
Expand All @@ -93,10 +95,6 @@ module.exports = () => {

process.exit()
})
.on('command:*', () => {
console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' '))
process.exit(1)
})

program.parse(process.argv)

Expand Down

0 comments on commit fb0ea54

Please sign in to comment.