From 5d963ee5d96644a44115d9b0ce5950a0e5139127 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Thu, 22 Jan 2026 13:02:41 -0800 Subject: [PATCH] feat: fix formatting of `codex features list` (#9715) The formatting of `codex features list` made it hard to follow. This PR introduces column width math to make things nice. Maybe slightly hard to machine-parse (since not a simple `\t`), but we should introduce a `--json` option if that's really important. You can see the before/after in the screenshot: image --- codex-rs/cli/src/main.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/codex-rs/cli/src/main.rs b/codex-rs/cli/src/main.rs index d620b8ab3..332f6314b 100644 --- a/codex-rs/cli/src/main.rs +++ b/codex-rs/cli/src/main.rs @@ -696,11 +696,20 @@ async fn cli_main(codex_linux_sandbox_exe: Option) -> anyhow::Result<() overrides, ) .await?; + let mut rows = Vec::with_capacity(codex_core::features::FEATURES.len()); + let mut name_width = 0; + let mut stage_width = 0; for def in codex_core::features::FEATURES.iter() { let name = def.key; let stage = stage_str(def.stage); let enabled = config.features.enabled(def.id); - println!("{name}\t{stage}\t{enabled}"); + name_width = name_width.max(name.len()); + stage_width = stage_width.max(stage.len()); + rows.push((name, stage, enabled)); + } + + for (name, stage, enabled) in rows { + println!("{name: