feat(cli): hidden --mode aliases — vendor/host#130
Open
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Open
feat(cli): hidden --mode aliases — vendor/host#130Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Mikola Lysenko (mikolalysenko) wants to merge 1 commit into
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Undocumented ergonomic aliases for
scan --mode:--mode vendorparses asvendored,--mode hostashosted— two#[value(alias = …)]attributes onScanMode. 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 showshosted:/vendored:/agent:and never the aliases. Env-hermetic viawith_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 --checkand 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