GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — id(repl): find/search/show/peek parsers silently swallow unknown and mistyped flags — a typo'd flag vanishes and its value becomes a query · Issue #2274 · developing-today/code Closed 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 DescriptionProblemThe REPL's find/search/show/peek argument parsers silently swallow malformed flags. Both parsers return plain values (no
Verified behavior (laptop probe, verbatim parsers extracted from main
|
| 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).
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.
--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.--dir, --format, --exclude, -o/--output, --lines/-n) with no following value is reported, not silently dropped.> (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).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.
🤖 Agent note · filed
> sets an empty output path. Verified with a laptop probe of the verbatim parsers (main 5a34fa7).--format validation, then routes the fix.🤖 Agent note · picked up
🤖 Agent note · handed off
🤖 Agent note · done
parse_find_args and parse_peek_args in pkgs/id/src/repl/runner.rs now bail on unknown flags, error on missing values via required_value, error on a bare >, carry invalid --format as format_error, and accept hyphen-prefixed --exclude patterns via required_pattern — with tests test_find_rejects_malformed_flags_and_redirects and test_peek_rejects_malformed_flags_and_missing_values in the tree. Closing as fixed.id workflow run for main is queued behind the current CI runner backlog and will confirm in CI.🤖 Agent note · done
--exclude -draft in 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.