Skip to content

id(repl): find/search/show/peek parsers silently swallow unknown and mistyped flags — a typo'd flag vanishes and its value becomes a query #2274

Closed

Description

@dezren39

Problem

The REPL's find/search/show/peek argument parsers silently swallow malformed flags. Both parsers return plain values (no Result), and any token they don't recognize is dropped without a word:

  • parse_find_args — pkgs/id/src/repl/runner.rs:627; the fall-through at :706 only collects tokens that do not start with -, so every unknown --flag vanishes.
  • parse_peek_args — runner.rs:1162; same fall-through at :1234.

Verified behavior (laptop probe, verbatim parsers extracted from main 5a34fa70, ~/git/fleet/probe-2026-10-29-laneB-replflags/)

Input Result
find report --bogus queries=["report"], no error — flag silently gone
find report --fist 2 (typo of --first) queries=["report", "2"] — the typo'd flag is dropped and its would-be value becomes a search query
find report --format yaml format="yaml" accepted verbatim; the match printers (helpers.rs print_match_cli/print_matches_cli, print_match_repl) fall through to the default format for any unknown value, so the user gets the default rendering with no hint their format was ignored
find report --dir / --exclude / --format (trailing, no value) silently no-op (runner.rs:659, :664, :701 guard on i + 1 < rest.len() and otherwise do nothing)
find report > output_file=Some(""), to_file=true (runner.rs:656 strip_prefix('>') accepts the empty path); the single-match path then calls ctx.get(name, Some(""))
peek report --bogus, peek report -o, peek report --lines same silent drops in parse_peek_args

Control: find report --all parses as expected (all=true).

Why it matters

The REPL is the interactive surface of id. A mistyped flag doesn't just fail to apply — it can change the query set (--fist 2 searches for 2), redirect output to an empty path, or render a different format than asked, all silently. Users have no way to tell their command wasn't the command that ran. The CLI side (clap) rejects unknown flags loudly; the REPL should not be the silent exception.

Distinct from #2009 (non-numeric --first/--last/--lines values becoming queries — a value-consumption bug in the same functions): this issue is about tokens the parsers never recognize at all, value-flags missing their value, and the bare > redirect.

Acceptance criteria

  • An unknown --flag in find/search/show/peek REPL commands produces a visible error or usage message naming the flag (triage pins: hard error vs warning-and-continue), and never silently alters the query set.
  • A value-flag (--dir, --format, --exclude, -o/--output, --lines/-n) with no following value is reported, not silently dropped.
  • A bare > (empty redirect target) is reported instead of setting output_file=Some("").
  • --format with a value outside {tag, group, union} is reported (or the printers stop falling through silently — triage pins which layer owns this).
  • Regression tests in runner.rs cover: unknown flag, typo'd flag with a following value, trailing value-flag, bare >, bad --format value; existing parser tests still pass.

Filed by new-issue-creator-code-b (Lane B), verified this run.

Activity

  1. developing-today commented on Oct 29, 2026

    @developing-today
    Contributor
  2. added
    queue/queuedHas a queued task in the Supabase agent queue
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/sSmall: expected under 2 hours of work
    on Oct 29, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-b)
    • Session / ID: new-issue-creator-code-b cron run 2026-10-29T11:26Z
    • Found via: filed this run
    • Task: Filed id(repl): find/search/show/peek parsers silently swallow unknown and mistyped flags — a typo'd flag vanishes and its value becomes a query #2274 — REPL find/search/show/peek parsers (runner.rs parse_find_args:627 / parse_peek_args:1162) silently drop unknown flags, typo'd-flag values become queries, trailing value-flags no-op, bare > sets an empty output path. Verified with a laptop probe of the verbatim parsers (main 5a34fa7).
    • Expectation: effort/s — triage pins error vs warning UX and which layer owns --format validation, then routes the fix.
    • Links: queue packet packet-2274-triage.json (repo-health-code-pilot)
  4. added
    queue/claimedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 31, 2026
  5. 4 remaining items

  6. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 31, 2026
  7. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  9. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  10. dezren39 commented on Nov 2, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions