While realigning the admin CLI onto the Dispatch + Run traits (#2951),
CodeRabbit surfaced four pre-existing rough edges in mlx command output. Each
is a behavior change, so they were deliberately kept out of that
no-behavior-change refactor -- this is the follow-up to tidy them up.
What this involves
- Honor the configured output sink. The
mlx config commands
(query/set/sync/compare) print via println!/printstd() and bypass
ctx.output_file. Thread &mut ctx.output_file through and use the async
write helpers so JSON/YAML/table output respects the selected destination.
(Heads up: most of mlx prints directly today, so decide how far to take this
-- it may be a broader pass than just config.) -- mlx/config/cmds.rs
- Error on unsupported CSV.
mlx config query prints CSV not supported yet
and exits 0 for --format csv; return a CarbideCliError so automation sees a
non-zero exit. -- mlx/config/cmds.rs
- Safe YAML for
profile list. The OutputFormat::Yaml arm hand-prints
scalars (println!(" - profile_name: {}", ...)), which can misrender values
needing escaping. Serialize through serde_yaml like the other YAML paths. --
mlx/profile/cmds.rs
- Fix the machine-report error wording.
InfoMachineCommand's handler says
no device report found for device -- should read ...for machine. --
mlx/info/cmds.rs
All four are pre-existing on main (not introduced by #2951); they were found
via CodeRabbit on PR #2953.
While realigning the admin CLI onto the
Dispatch+Runtraits (#2951),CodeRabbit surfaced four pre-existing rough edges in
mlxcommand output. Eachis a behavior change, so they were deliberately kept out of that
no-behavior-change refactor -- this is the follow-up to tidy them up.
What this involves
mlx configcommands(
query/set/sync/compare) print viaprintln!/printstd()and bypassctx.output_file. Thread&mut ctx.output_filethrough and use the asyncwrite helpers so JSON/YAML/table output respects the selected destination.
(Heads up: most of
mlxprints directly today, so decide how far to take this-- it may be a broader pass than just
config.) --mlx/config/cmds.rsmlx config queryprintsCSV not supported yetand exits 0 for
--format csv; return aCarbideCliErrorso automation sees anon-zero exit. --
mlx/config/cmds.rsprofile list. TheOutputFormat::Yamlarm hand-printsscalars (
println!(" - profile_name: {}", ...)), which can misrender valuesneeding escaping. Serialize through
serde_yamllike the other YAML paths. --mlx/profile/cmds.rsInfoMachineCommand's handler saysno device report found for device-- should read...for machine. --mlx/info/cmds.rsAll four are pre-existing on
main(not introduced by #2951); they were foundvia CodeRabbit on PR #2953.