Skip to content

feat(cli): hidden --mode aliases — vendor/host#130

Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
feat/scan-mode-aliases
Open

feat(cli): hidden --mode aliases — vendor/host#130
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
mainfrom
feat/scan-mode-aliases

Conversation

@mikolalysenko

Copy link
Copy Markdown
Collaborator

What

Undocumented ergonomic aliases for scan --mode: --mode vendor parses as vendored, --mode host as hosted — two #[value(alias = …)] attributes on ScanMode. Help output is unchanged by design (aliases stay hidden).

Tests (cli_parse_scan, all RED-verified)

  • mode_alias_vendor_folds_to_vendor / mode_alias_host_folds_to_redirect — aliases fold to the right legacy boolean, and only that one.
  • mode_alias_host_with_vendor_boolean_errors_with_canonical_name — cross-mode contradiction via an alias still errors, and the message names the canonical mode (--mode hosted), never the alias spelling.
  • mode_aliases_hidden_from_help — renders scan's help and asserts the possible-values segment is exactly [possible values: hosted, vendored, agent] (segment match, since "vendored" contains "vendor"), and the long-help item list shows hosted:/vendored:/agent: and never the aliases. Env-hermetic via with_clean_env.

RED-guards: with the alias attributes removed the three fold tests fail at parse (clap InvalidValue); the help test was RED-verified by temporarily renaming a value to simulate a leak. 47/47 green on the branch; cargo fmt --check and clippy clean.

Split out from the strapi vendored-install debugging session per review request — unrelated to the redirect fix in #131's lineage.

🤖 Generated with Claude Code

…hosted

Ergonomic (deliberately undocumented) clap value aliases on ScanMode:
`--mode vendor` == `--mode vendored`, `--mode host` == `--mode hosted`.
Help output is unchanged — a test renders scan's help and asserts the
possible-values segment is exactly `hosted, vendored, agent` (segment
match, since "vendored" contains "vendor" as a substring), and that the
long-help item list never shows the alias spellings.

New cli_parse_scan tests (RED-verified by removing the alias attrs /
simulating a value-name leak):
- mode_alias_vendor_folds_to_vendor
- mode_alias_host_folds_to_redirect
- mode_alias_host_with_vendor_boolean_errors_with_canonical_name
  (cross-mode fold error keeps naming the canonical mode)
- mode_aliases_hidden_from_help (env-hermetic via with_clean_env)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant