Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/gold-rats-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@abstract-money/cli": patch
---

Fixed a small issue where `--help` output was shown twice.
5 changes: 3 additions & 2 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ void (async () => {
// Parse CLI args without running command
cli.parse(process.argv, { run: false })
if (!cli.matchedCommand) {
if (cli.args.length === 0) cli.outputHelp()
else throw new Error(`Unknown command: ${cli.args.join(' ')}`)
if (cli.args.length === 0) {
if (!cli.options.help && !cli.options.version) cli.outputHelp()
} else throw new Error(`Unknown command: ${cli.args.join(' ')}`)
}
await cli.runMatchedCommand()
} catch (error) {
Expand Down