trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

tools - traffic_ctl, traffic_layout: use ArgParse groups to handle mutually exclusive options.

Open brbzull0 opened this issue 2 months ago • 2 comments

Make sure we express the intentions properly, using mutex groups from ArgParse. ~~https://github.com/apache/trafficserver/pull/12621 needs to go in first, I'll leave this as draft till we get the first pr sorted.~~ DONE

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

relates to https://github.com/apache/trafficserver/issues/12605

brbzull0 avatar Oct 29 '25 13:10 brbzull0

[approve ci]

brbzull0 avatar Nov 11 '25 09:11 brbzull0

[approve ci autest 2]

brbzull0 avatar Nov 11 '25 09:11 brbzull0