GeezerVison is showing github.com — feat(cli): hidden --mode aliases — vendor/host by mikolalysenko · Pull Request #130 · SocketDev/socket-patch
Conversation
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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…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 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.