Skip to content

Fail closed on invalid CLI options - #2696

Merged
Widthdom merged 4 commits into
mainfrom
fix-issue1801-1803-1705-1700
May 25, 2026
Merged

Fail closed on invalid CLI options#2696
Widthdom merged 4 commits into
mainfrom
fix-issue1801-1803-1705-1700

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Add explicit regression coverage for out-of-range numeric query flags such as --depth 999999999.
  • Reject unknown dash-prefixed query tokens unless they are passed after -- as literals.
  • Make cdidx index unknown options fatal usage errors with did-you-mean hints instead of warning and continuing.

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~QueryCommandRunnerTests|FullyQualifiedName~IndexCommandRunnerTests" --no-restore
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj --filter "FullyQualifiedName~RunImpact_OutOfRangeDepthUpperBound_ReturnsUsageError_Issue1700|FullyQualifiedName~RunSearch_UnknownFlagAfterQuery_ReturnsUsageError|FullyQualifiedName~Run_UnknownIndexOption_ReturnsUsageError|FullyQualifiedName~ParseArgs_EndOfOptionsAllowsDashPrefixed|FullyQualifiedName~RunSearch_EndOfOptionsAcceptsOptionLookingLiteral|FullyQualifiedName~ParseArgs_UnknownIndexOption" --no-restore
  • dotnet run --project tools/CodeIndex.Changelog -- check
  • adversarial review: No blocking/actionable issues found.

Documentation / Changelog

  • changelog.d/unreleased/1700.fixed.md
  • changelog.d/unreleased/1705-1801.fixed.md
  • changelog.d/unreleased/1803.fixed.md

Issues

Fixes #1700
Fixes #1705
Fixes #1801
Fixes #1803

Follow-up Candidates

None.

@Widthdom
Widthdom marked this pull request as ready for review May 25, 2026 08:39
@Widthdom
Widthdom merged commit c38ce54 into main May 25, 2026
10 checks passed
@Widthdom
Widthdom deleted the fix-issue1801-1803-1705-1700 branch May 25, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant