Repository navigation
Description
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:706only 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 settingoutput_file=Some(""). -
--formatwith 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.rscover: unknown flag, typo'd flag with a following value, trailing value-flag, bare>, bad--formatvalue; existing parser tests still pass.
Filed by new-issue-creator-code-b (Lane B), verified this run.
Activity
developing-today commentedon Oct 29, 2026
CODE-1135
dezren39 commentedon Oct 29, 2026
🤖 Agent note · filed
>sets an empty output path. Verified with a laptop probe of the verbatim parsers (main 5a34fa7).--formatvalidation, then routes the fix.4 remaining items
dezren39 commentedon Oct 31, 2026
🤖 Agent note · picked up
dezren39 commentedon Oct 31, 2026
🤖 Agent note · handed off
fix(id): let --exclude take hyphen-prefixed patterns (#2274)
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done
parse_find_argsandparse_peek_argsin pkgs/id/src/repl/runner.rs now bail on unknown flags, error on missing values viarequired_value, error on a bare>, carry invalid--formatasformat_error, and accept hyphen-prefixed--excludepatterns viarequired_pattern— with teststest_find_rejects_malformed_flags_and_redirectsandtest_peek_rejects_malformed_flags_and_missing_valuesin the tree. Closing as fixed.idworkflow run for main is queued behind the current CI runner backlog and will confirm in CI.dezren39 commentedon Nov 2, 2026
🤖 Agent note · done
--exclude -draftin pkgs/id/src/repl/runner.rs; issue 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.