Skip to content

Promote unknown-option warning on index subcommand to fatal error #1803

Description

@Widthdom

Summary

IndexCommandRunner (IndexCommandRunner.cs:440) handles unknown options on the index subcommand by printing Warning: unknown option '--verbos' (ignored) and continuing the run. A user typing cdidx index . --verbos therefore believes they enabled verbose output, completes a 30-minute index, and discovers afterwards that no verbose log was produced. Warn-and-continue masks typos at the worst possible moment for long-running operations.

Where

  • src/CodeIndex/Cli/IndexCommandRunner.cs:440 (unknown option warning)

Suggested approach

(1) Promote unknown options on index from warning to fatal error with a non-zero exit code (EX_USAGE = 64), matching the rest of the CLI's stricter contract. (2) When promoting, surface a "did you mean" suggestion (cross-link #1582) so the fix is one keystroke away. (3) For back-compat, gate the strict behavior behind a major version bump or a transition flag (CDIDX_STRICT_FLAGS=1) that defaults to strict in the next minor. (4) Add a regression test that asserts index . --verbos exits 64 with an unknown-option error. (5) Cross-link with #401 (positional-fallthrough fix) — sibling typo-handling concern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions