Skip to content

Commit

Permalink
Return early on error if commander version or help is thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldelcore committed Jan 28, 2022
1 parent 41aa784 commit d0ebfd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/curly-toes-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@codeshift/cli': patch
---

Fixed bug where --version & --help are presented as errors
5 changes: 4 additions & 1 deletion packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ program.exitOverride();
await program.parseAsync(process.argv);
} catch (error) {
if (error instanceof CommanderError) {
if (error.message === '(outputHelp)') {
if (
error.code === 'commander.helpDisplayed' ||
error.code === 'commander.version'
) {
return;
}

Expand Down

0 comments on commit d0ebfd5

Please sign in to comment.