Skip to content

Commit 1cadf63

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 - repl - compile commands - keys commands
1 parent 67011b3 commit 1cadf63

File tree

4 files changed

+485
-105
lines changed

4 files changed

+485
-105
lines changed

Cargo.lock

Lines changed: 71 additions & 2 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
@@ -20,6 +20,7 @@ log = "0.4"
2020
serde_json = "1.0"
2121
thiserror = "2.0.11"
2222
tokio = { version = "1", features = ["full"] }
23+
cli-table = "0.5.0"
2324

2425
# Optional dependencies
2526
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)