tools - traffic_ctl, traffic_layout: use ArgParse groups to handle mutually exclusive options.#12623
Open
brbzull0 wants to merge 2 commits intoapache:masterfrom
Open
tools - traffic_ctl, traffic_layout: use ArgParse groups to handle mutually exclusive options.#12623brbzull0 wants to merge 2 commits intoapache:masterfrom
brbzull0 wants to merge 2 commits intoapache:masterfrom
Conversation
Contributor
Author
|
[approve ci] |
Contributor
Author
|
[approve ci autest 2] |
mutually exclusive options. traffic_ctl: Usage: traffic_ctl [OPTIONS] CMD [ARGS ...] Commands ---------------------- Description ----------------------- drain Drain the requests Options ======================= Default ===== Description ============= Group (drain_mode) -N, --no-new-connection Wait for new connections down to threshold before starting draining -U, --undo Recover server from the drain mode traffic_layout: Usage: traffic_layout CMD [OPTIONS] Commands ---------------------- Description ----------------------- info Show the layout as default Options ======================= Default ===== Description ============= -j, --json Produce output in JSON format (when supported) Group (display_mode) --features Show the compiled features --versions Show various library and other versioning information
8f31ef8 to
826c4ae
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community. |
Contributor
Author
|
[approve ci] |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request implements mutually exclusive option groups in two command-line tools (traffic_ctl and traffic_layout) using the new ArgParser mutex group feature from PR #12621. The changes ensure that conflicting options are properly validated and documented.
Changes:
- Added mutex group for
traffic_layout infocommand to make--featuresand--versionsmutually exclusive - Added mutex group for
traffic_ctl server draincommand to make--no-new-connectionand--undomutually exclusive
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/traffic_layout/traffic_layout.cc | Refactored info command to use mutex group for --features and --versions options, making them mutually exclusive display modes |
| src/traffic_ctl/traffic_ctl.cc | Refactored server drain command to use mutex group for --no-new-connection and --undo options, making them mutually exclusive drain modes |
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.
Make sure we express the intentions properly, using mutex groups from ArgParse.
#12621 needs to go in first, I'll leave this as draft till we get the first pr sorted.DONEtraffic_ctl:
traffic_layout:
relates to #12605