Skip to content

Commit abd3db5

Browse files
authored
show suggestions after an error for an unknown command or option (#572)
* chore(deps): upgrade 'commander' to 8.2.0 * feat: show suggestions after an error for an unknown command or option
1 parent 5513e64 commit abd3db5

File tree

4 files changed

+2779
-2734
lines changed

4 files changed

+2779
-2734
lines changed

bin/node-lambda

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ const DOCKER_VOLUMES = process.env.DOCKER_VOLUMES || ''
6161
const AWS_TAGS = process.env.AWS_TAGS || ''
6262
const IMAGE_URI = process.env.IMAGE_URI || ''
6363

64+
program.showSuggestionAfterError()
65+
6466
program
6567
.command('deploy')
6668
.description('Deploy your application to Amazon Lambda')
@@ -159,12 +161,6 @@ program
159161
.option('-x, --contextFile [CONTEXT_FILE]', 'Context JSON File', CONTEXT_FILE)
160162
.action((prg) => lambda.setup(prg))
161163

162-
program.on('command:*', (cmd) => {
163-
console.log(`Unknown command ${cmd}`)
164-
console.log()
165-
program.help()
166-
})
167-
168164
program
169165
.version(lambda.version)
170166
.parse(process.argv)

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"archiver": "^5.3.0",
4646
"aws-sdk": "^2.936.0",
4747
"aws-xray-sdk-core": "^3.3.3",
48-
"commander": "^8.0.0",
48+
"commander": "^8.2.0",
4949
"continuation-local-storage": "^3.2.1",
5050
"dotenv": "^10.0.0",
5151
"fs-extra": "^10.0.0",

0 commit comments

Comments
 (0)