Skip to content

Feature: multi-format output support - #322

Closed
emma31-dev wants to merge 8 commits into
bitcoindevkit:masterfrom
emma31-dev:feat/multi-output-support
Closed

Feature: multi-format output support#322
emma31-dev wants to merge 8 commits into
bitcoindevkit:masterfrom
emma31-dev:feat/multi-output-support

Conversation

@emma31-dev

@emma31-dev emma31-dev commented Sep 12, 2026

Copy link
Copy Markdown

Description

This PR started with an observation of an unused dependency cli-table. After seeing the commit of it 1 year ago i realized the author wanted to add support for pretty output. So i decided to expand it into a full suit of output format CLI option with JSON and TOML. (table support for all output would require adding more lines of code with little benefits)

Notes to the reviewers

Changes incomplete

Changelog notice

  • Support for JSON and TOML format through --format flag.

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature
  • I've updated CHANGELOG.md

Introduce `OutputFormatType` enum and `--format` flag to let users
choose between JSON (default), table, and TOML output. Thread the
format through all command handlers, the REPL, and `FormatOutput`.

Table rendering serializes values to JSON, extracts columns from
record objects, and falls back to JSON for non-tabular data.
@emma31-dev

Copy link
Copy Markdown
Author

The full feature will take a while to complete to ensure neat output

@emma31-dev
emma31-dev marked this pull request as draft September 12, 2026 14:15
Apply rustfmt formatting to improve line breaks and
import ordering across handler and utility modules.
Replace the manual JSON-to-table rendering with cli_table's
`print_stdout`, requiring `Table` to be implemented on output types.
Table formatting now writes directly to stdout via `print_stdout`
instead of being serialized into a string, so the `format` method
returns an empty string for `OutputFormatType::Table`.
The `cli_table` dependency is no longer used for formatting output,
leaving only JSON and TOML formats available.
@emma31-dev
emma31-dev force-pushed the feat/multi-output-support branch from 9b124b6 to 541a9eb Compare September 12, 2026 15:41
@tvpeter

tvpeter commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

@emma31-dev can you please minimize the amount of pushes? It is too noisy

@emma31-dev

Copy link
Copy Markdown
Author

so sorry i am a micro commit guy. I fix all the remaining issues in the next commit
sorry again.

@tvpeter

tvpeter commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

PR #278 dropped support for other display formats. Commit 528956d dropped the pretty table support.

@tvpeter tvpeter closed this Sep 12, 2026
@github-project-automation github-project-automation Bot moved this to Done in BDK-CLI Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants