apache / apache/trafficserver

Refactor: Separate output formatting from command logic in `traffic_ctl`

Open
#12,911 0 comments 0 reactions 1 assignee Claimed by @brbzull0 View on GitHub
Cleanup Tools traffic_ctl
Dominant language
C++
Stars
2k
Forks
874
Avg merge
6d 15h
Merged PRs (30d)
46

Description

# 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.