Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ page. See [DEVELOPMENT_CYCLE.md](DEVELOPMENT_CYCLE.md) for more details.
## [Unreleased]

- Removed MSRV and bumped Rust Edition to 2024
- Add `--pretty` top level flag for formatting commands output in a tabular format

## [1.0.0]

Expand Down
73 changes: 71 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ log = "0.4"
serde_json = "1.0"
thiserror = "2.0.11"
tokio = { version = "1", features = ["full"] }
cli-table = "0.5.0"

# Optional dependencies
bdk_bitcoind_rpc = { version = "0.20.0", optional = true }
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,12 @@ Note: You can modify the `Justfile` to reflect your nodes' configuration values.
cargo run --features rpc -- wallet -u "127.0.0.1:18443" -c rpc -a user:password sync
cargo run --features rpc -- wallet -u "127.0.0.1:18443" -c rpc -a user:password balance
```

## Formatting Responses using `--pretty` flag

You can optionally return outputs of commands in human-readable, tabular format instead of `JSON`. To enable this option, simply add the `--pretty` flag as a top level flag. For instance, you wallet's balance in a pretty format, you can run:

```shell
cargo run --pretty -n signet wallet -w {wallet_name} -d sqlite balance
```
This is available for wallet, key, repl and compile features. When ommitted, outputs default to `JSON`.
3 changes: 3 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ pub struct CliOpts {
/// Default value : ~/.bdk-bitcoin
#[arg(env = "DATADIR", short = 'd', long = "datadir")]
pub datadir: Option<std::path::PathBuf>,
/// Output results in pretty format (instead of JSON).
#[arg(long = "pretty")]
pub pretty: bool,
/// Top level cli sub-commands.
#[command(subcommand)]
pub subcommand: CliSubCommand,
Expand Down
Loading
Loading