Skip to content

Commit 2ba0b94

Browse files
committed
feat(pretty-fmt): add cli-table to format output
- add cli-table and `--pretty` flag to format output of commands in a tabular form for: - offline wallet commands
1 parent 7a71b14 commit 2ba0b94

File tree

5 files changed

+418
-93
lines changed

5 files changed

+418
-93
lines changed

Cargo.lock

Lines changed: 69 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ log = "0.4"
2121
serde_json = "1.0"
2222
thiserror = "2.0.11"
2323
tokio = { version = "1", features = ["full"] }
24+
cli-table = "0.5.0"
2425

2526
# Optional dependencies
2627
bdk_bitcoind_rpc = { version = "0.20.0", optional = true }

src/commands.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ pub struct CliOpts {
5151
/// Default value : ~/.bdk-bitcoin
5252
#[arg(env = "DATADIR", short = 'd', long = "datadir")]
5353
pub datadir: Option<std::path::PathBuf>,
54+
/// Output results in pretty format (instead of JSON).
55+
#[arg(long = "pretty")]
56+
pub pretty: bool,
5457
/// Top level cli sub-commands.
5558
#[command(subcommand)]
5659
pub subcommand: CliSubCommand,

0 commit comments

Comments
 (0)