feat(cli): Add service command version dispatch#1848
Merged
Conversation
gtema
force-pushed
the
claude/openstack-cli-version-dispatch-81l1nz
branch
2 times, most recently
from
July 13, 2026 13:29
2a22ab9 to
69f65cc
Compare
Each crate's wrapper type now hand-implements clap::Args and clap::FromArgMatches (the pattern clap itself documents in examples/derive_ref/hand_subcommand.rs and flatten_hand_args.rs) instead of deriving Parser over a trailing_var_arg capture. A small shared resolve_api_version() helper in cli/core scans the real process args once to decide which version's subcommand tree to merge into the single Command clap builds; from_arg_matches then reads the clap-parsed (env/default-aware) value to pick the matching variant. Since there is only ever one tree now, GlobalOpts (flattened once, as before, on the top-level Cli) is naturally visible in --help everywhere, with no per-crate duplication. Assisted-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Artem Goncharov <artem.goncharov@gmail.com>
gtema
force-pushed
the
claude/openstack-cli-version-dispatch-81l1nz
branch
from
July 13, 2026 13:40
69f65cc to
54b7ebd
Compare
Open
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.
Each crate's wrapper type now hand-implements clap::Args and
clap::FromArgMatches (the pattern clap itself documents in
examples/derive_ref/hand_subcommand.rs and flatten_hand_args.rs)
instead of deriving Parser over a trailing_var_arg capture. A small
shared resolve_api_version() helper in cli/core scans the real process
args once to decide which version's subcommand tree to merge into the
single Command clap builds; from_arg_matches then reads the
clap-parsed (env/default-aware) value to pick the matching variant.
Since there is only ever one tree now, GlobalOpts (flattened once, as
before, on the top-level Cli) is naturally visible in --help
everywhere, with no per-crate duplication.
Assisted-By: Claude Sonnet 5 noreply@anthropic.com
Signed-off-by: Artem Goncharov artem.goncharov@gmail.com