Skip to content

fix: report specific CLI parser errors in JSON - #166

Merged
danielsitek merged 1 commit into
mainfrom
feature/dsi-unknown-option-errors
Oct 21, 2026
Merged

danielsitek merged 1 commit into
mainfrom
feature/dsi-unknown-option-errors

Conversation

@danielsitek

Copy link
Copy Markdown
Owner

Summary

  • Preserve Commander parser error text in invalid_usage JSON responses, including the offending option and available typo suggestions.
  • Keep human-readable help behavior unchanged.
  • Cover missing arguments, unknown commands, unknown options, and typo suggestions.

Verification

  • bun test src/cli/index.test.ts
  • bun run check (755 passed, 1 skipped; build and compiled smoke passed)

Closes #165

@codacy-production

codacy-production Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.00% coverage variation

Metric Results
Coverage variation ✅ +0.00% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (5c09043) 7734 7574 97.93%
Head commit (798cae3) 7735 (+1) 7575 (+1) 97.93% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#166) 2 2 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@danielsitek
danielsitek merged commit 2820e88 into main Oct 21, 2026
11 checks passed
@danielsitek
danielsitek deleted the feature/dsi-unknown-option-errors branch October 21, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown option error doesn't name the option (--file vs --notes-file)

1 participant