Title: id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output · Issue #2773 · developing-today/code · GitHub
Open Graph Title: id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output · Issue #2773 · developing-today/code
X Title: id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output · Issue #2773 · developing-today/code
Description: id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output Evidence (main fe47fa09) pkgs/id/src/cli.rs:891 (Find) and pkgs/id/src/cli.rs:958 (Search): --format is a bare ...
Open Graph Description: id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output Evidence (main fe47fa09) pkgs/id/src/cli.rs:891 (Find) and pkgs/id/src/...
X Description: id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output Evidence (main fe47fa09) pkgs/id/src/cli.rs:891 (Find) and pkgs/id/src/...
Opengraph URL: https://github.com/developing-today/code/issues/2773
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output","articleBody":"# id(find/search): `--format` accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output\n\n## Evidence (main `fe47fa09`)\n\n- `pkgs/id/src/cli.rs:891` (`Find`) and `pkgs/id/src/cli.rs:958` (`Search`): `--format` is a bare `String` with `default_value = \"tag\"` and **no `value_parser`**. The same file validates sibling options — `value_parser = [...]` lists at cli.rs:1412, 1946, 1966, 2004, 2007 and `ValueEnum` types at cli.rs:1345, 1355 — so the omission is local to these two args.\n- `pkgs/id/src/main.rs:319-347` passes `&format` straight into `cmd_find` / `cmd_search` with no check.\n- The printers treat every unrecognized value as `tag`:\n - `pkgs/id/src/helpers.rs` `print_match_cli` (lines 155-175): `\"group\"` / `\"union\"` arms, `_` arm renders the tag format.\n - `print_matches_cli` (lines 192-243): same `_` fallthrough.\n - `print_match_repl` (lines 246-268): same `_` fallthrough, fed by the REPL parser at `pkgs/id/src/repl/runner.rs:666`, which assigns the `--format` value verbatim.\n\n## Verified behavior (probe, laptop `~/git/fleet/probe-2026-10-30-laneA-findformat/`)\n\nThe printers' match logic, copied verbatim with the match type stubbed, run over one match:\n\n```\n--- format=\"tag\" -> abc123\u003cTAB>config.json\u003cTAB>(config)\n--- format=\"group\" -> [config] / indented hash+name\n--- format=\"union\" -> abc123\u003cTAB>config.json\n--- format=\"gorup\" -> abc123\u003cTAB>config.json\u003cTAB>(config) (== tag)\n--- format=\"yaml\" -> abc123\u003cTAB>config.json\u003cTAB>(config) (== tag)\n--- format=\"GROUP\" -> abc123\u003cTAB>config.json\u003cTAB>(config) (== tag)\n--- format=\"\" -> abc123\u003cTAB>config.json\u003cTAB>(config) (== tag)\n```\n\nSo `id find --format gorup config` and `id search --format yaml config` exit 0 and print tag-formatted output. Nothing tells the user the format was not understood.\n\n## Why it matters\n\n`--format` exists for scripts and for grouped/deduplicated reading. A mistyped or case-mismatched value silently produces a different shape than the caller asked for — the worst failure mode for a formatting flag, because the output still looks plausible and a script parsing `group` headers or `union` dedup semantics consumes tag rows instead. Every other enumerated CLI option in this file rejects bad values at parse time via clap; these two are the outliers.\n\nSecondary, same surface: the module doc at `pkgs/id/src/commands/find.rs:24-28` says \"**union**: Default format\", while the CLI default is `tag` (cli.rs:890/957 `default_value = \"tag\"`, help text \"tag (default)\"). The doc should be corrected with the fix.\n\n## Acceptance criteria\n\n- `id find --format \u003canything other than tag|group|union>` and the same for `id search` fail at argument parsing with a clap error naming the accepted values (e.g. via `value_parser` or a `ValueEnum`, matching the file's existing patterns).\n- The REPL `find`/`search` `--format` value is validated the same way, or the shared printers' fallthrough is otherwise made unreachable with an unknown value.\n- The `commands/find.rs` module doc no longer calls `union` the default.\n- A CLI parse test (alongside `test_cli_parse_find_with_format`, cli.rs:2609) pins that an invalid `--format` is rejected for both `find` and `search`.\n\nDedup: #2274 covers the REPL parsers swallowing unknown/mistyped *flags*; this is the distinct point that an accepted flag's *value* is never validated on either surface. No open or recently closed issue covers `--format` value validation.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-30T14:41:22Z","url":"https://github.com/developing-today/code/issues/2773"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:56985e47-d890-92fe-93a3-de1137582ee3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF56:38C88D:441661:5D5B32:6B0751B6 |
| html-safe-nonce | cde21f72d811433d10c5d919368927cdf643909c25cb860ec31dfb2ed32a5c41 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjU2OjM4Qzg4RDo0NDE2NjE6NUQ1QjMyOjZCMDc1MUI2IiwidmlzaXRvcl9pZCI6Ijc0ODkyMjExODI2MzA2MTM0MzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9052f87f906de4b6e54ae36bfdbb8d9e126fe8e2128719b3b4c5d69fed9a69a7 |
| hovercard-subject-tag | issue:6121183544 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/2773/issue_layout |
| twitter:image | https://opengraph.githubassets.com/89e83514d1bd69afc1c5f5eee3c9b041bc3e714296f50d9fefc78ba3706d95a1/developing-today/code/issues/2773 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/89e83514d1bd69afc1c5f5eee3c9b041bc3e714296f50d9fefc78ba3706d95a1/developing-today/code/issues/2773 |
| og:image:alt | id(find/search): --format accepts any string and silently renders the tag format — a typo gets plausible-looking wrong output Evidence (main fe47fa09) pkgs/id/src/cli.rs:891 (Find) and pkgs/id/src/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 663b1a69a41309856ffd9403fa5b764f6c0f78a39a0a8f75fb2c205c96a947be |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | effa2c0a160a75bd95d9ffcc6320197d7aea0d83 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width