Skip to content

Refactor: Separate output formatting from command logic in traffic_ctl #12911

@brbzull0

Description

@brbzull0

Refactor: Separate output formatting from command logic in traffic_ctl

Summary

Output formatting responsibilities are split between CtrlCommand subclasses and BasePrinter subclasses. The intended design is that commands handle logic/RPC and printers handle output formatting. In practice, both sides do formatting and neither fully owns it.

This was the initial goal, but it got sidetracked — it was easy to implement the text formatting as early as possible in the command layer, and over time that pattern spread.

Desired state

Commands should produce structured data (or call domain-level output methods) and never construct user-facing text, check format flags, or reference concrete printer types. The output layer should fully own how data is rendered for each format.
This was the initial goal, but it got side tracked

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions