mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
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: <img width="1119" height="932" alt="image" src="https://github.com/user-attachments/assets/c99dce85-899a-4a2d-b4af-003938f5e1df" />
This commit is contained in:
@@ -696,11 +696,20 @@ async fn cli_main(codex_linux_sandbox_exe: Option<PathBuf>) -> 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:<name_width$} {stage:<stage_width$} {enabled}");
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user