Skip to content

Commit

Permalink
fix: show help on illegal option value
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondill committed Feb 2, 2023
1 parent c183b60 commit 834ea29
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ function run() {
} catch (error) {
process.exitCode = 2
console.error(error.message)
if (error.code === 'ERR_PARSE_ARGS_UNKNOWN_OPTION') {
if (
error.code === 'ERR_PARSE_ARGS_UNKNOWN_OPTION' ||
error.code === 'ERR_PARSE_ARGS_INVALID_OPTION_VALUE'
) {
console.error(`Try 'sort-package-json --help' for more information.`)
}
return
Expand Down

0 comments on commit 834ea29

Please sign in to comment.