Skip to content

Fix --format yaml and toml output#1653

Merged
jglogan merged 1 commit into
apple:mainfrom
realrajaryan:fix-yaml-toml-output
Jun 5, 2026
Merged

Fix --format yaml and toml output#1653
jglogan merged 1 commit into
apple:mainfrom
realrajaryan:fix-yaml-toml-output

Conversation

@realrajaryan

@realrajaryan realrajaryan commented Jun 5, 2026

Copy link
Copy Markdown
Member

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Several commands (builder status, image list, stats, system df, system status) advertised --format yaml and --format toml but only handled json, and every other format fell through to the table. With this PR, we now route them through one shared renderer with an exhaustive switch over the format enum, so a missing format would now be a compile error, and not just fail silently.

Few more things to note:

  • Since TOML has no top level array, TOML output now wraps list payloads under an items key, bec otherwise it was returning nothing for lists.
  • stats now prints one static result for machine readable formats instead of opening its live table view.
  • builder status now returns an empty list for json/yaml/toml when no builder is running, instead of the unparseable "builder is not running" text. The table view keeps the message.
  • with -q and no builder it now exits 0 with no output, earlier it exited non-zero.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

@realrajaryan realrajaryan requested a review from jglogan June 5, 2026 08:00
@github-actions github-actions Bot added the cli label Jun 5, 2026
@realrajaryan realrajaryan added this to the 2026-05 milestone Jun 5, 2026
@tico88612 tico88612 mentioned this pull request Jun 5, 2026
7 tasks
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Code Coverage

Tier Line Coverage
Unit 34.68%
Integration 19.73%
Combined 53.79%

@jglogan jglogan merged commit 822b47b into apple:main Jun 5, 2026
4 checks passed
@realrajaryan realrajaryan deleted the fix-yaml-toml-output branch June 5, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Several commands accept --format yaml but emit table or plain text

2 participants