Skip to content

'--top' alias accepted by parser but not mentioned in any per-command help usage line #1422

Description

@Widthdom

Summary

The parser in QueryCommandRunner accepts both --limit and --top as synonyms for the result-cap flag. However, the per-command usage lines printed by ConsoleUi only show --limit. AI agents and shell-completion authors that scrape per-command help will miss --top entirely.

Evidence

  • Parser: src/CodeIndex/Cli/QueryCommandRunner.cs:2756-2767 recognises both --limit and --top.
  • Reference flag block: src/CodeIndex/Cli/ConsoleUi.cs:387 documents --limit <n>, --top <n>.
  • Per-command usage lines: src/CodeIndex/Cli/ConsoleUi.cs:19-36 show only --limit for the 16+ subcommands that accept the flag.

Impact

  • AI / completion: agents parsing each command's --help won't surface --top.
  • Inconsistency: cdidx search --top 5 text works, but cdidx search --help doesn't mention it.

Proposed direction

Pick one:

  • Drop --top (mark deprecated, keep parser support for a release, then remove). Simplest.
  • Or document --top consistently in every usage line + shell completion script.

Either way, align on a single canonical name.

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