Skip to content

excerpt rejects --start-line/--end-line aliases without suggesting --start/--end #1429

Description

@Widthdom

Summary

The CLI excerpt subcommand uses --start / --end, but the equivalent MCP tool uses startLine / endLine. Users migrating between the two surfaces naturally try --start-line / --end-line first. The CLI rejects that with:

Error: --start-line is not supported for excerpt.
Hint: remove `--start-line` and rerun, or use only the options shown in `excerpt --help`.

The hint says "remove --start-line and rerun" but does not suggest the correct flag name (--start). For agents/users seeing this for the first time it is a needless friction point.

Reproduction

cdidx excerpt src/CodeIndex/Program.cs --start-line 5 --end-line 10

Impact

  • Agents that follow the MCP shape verbatim trip on this.
  • The error message is correct but not actionable.

Proposed direction

Pick one:

  • Accept --start-line / --end-line as aliases (cheap, no behaviour change).
  • Or — improve the error to "Did you mean --start?" by mapping each known-unsupported flag to its closest valid synonym (small static map maintained alongside the parser).

The same principle applies anywhere else the CLI rejects an unknown flag with a generic message.

Repro env

  • Branch: main @ 2ee912d (release v1.21.0)

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