Skip to content

Commit b1a05a6

Browse files
committed
feat(pretty-fmt): update README for pretty flag
- update README for `--pretty` flag - update CHANGELOG
1 parent 6384de1 commit b1a05a6

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ page. See [DEVELOPMENT_CYCLE.md](DEVELOPMENT_CYCLE.md) for more details.
66
## [Unreleased]
77

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

1011
## [1.0.0]
1112

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,17 @@ Note: You can modify the `Justfile` to reflect your nodes' configuration values.
193193
cargo run --features rpc -- wallet -u "127.0.0.1:18443" -c rpc -a user:password sync
194194
cargo run --features rpc -- wallet -u "127.0.0.1:18443" -c rpc -a user:password balance
195195
```
196+
197+
## Formatting Responses using `--pretty` flag
198+
199+
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:
200+
201+
```shell
202+
cargo run --pretty -n signet wallet -w {wallet_name} -d sqlite balance
203+
```
204+
205+
This is available for wallet, key, repl and compile features. When ommitted, outputs default to `JSON`.
206+
207+
## Minimum Supported Rust Version (MSRV)
208+
209+
This library should always compile with any valid combination of features on Rust **1.75.0**.

src/handlers.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ use crate::utils::BlockchainClient::KyotoClient;
1818
use crate::utils::*;
1919
use bdk_wallet::bip39::{Language, Mnemonic};
2020
use bdk_wallet::bitcoin::{
21+
Amount, FeeRate, Network, Psbt, Sequence, Txid,
2122
bip32::{DerivationPath, KeySource},
2223
consensus::encode::serialize_hex,
2324
script::PushBytesBuf,
2425
secp256k1::Secp256k1,
25-
Amount, FeeRate, Network, Psbt, Sequence, Txid,
2626
};
2727
use bdk_wallet::chain::ChainPosition;
2828
use bdk_wallet::descriptor::Segwitv0;
@@ -34,11 +34,11 @@ use bdk_wallet::{
3434
descriptor::{Descriptor, Legacy, Miniscript},
3535
miniscript::policy::Concrete,
3636
};
37-
use cli_table::{format::Justify, Cell, CellStruct, Style, Table};
37+
use cli_table::{Cell, CellStruct, Style, Table, format::Justify};
3838

3939
use bdk_wallet::keys::{
40-
bip39::WordCount, DerivableKey, DescriptorKey, DescriptorKey::Secret, ExtendedKey,
41-
GeneratableKey, GeneratedKey,
40+
DerivableKey, DescriptorKey, DescriptorKey::Secret, ExtendedKey, GeneratableKey, GeneratedKey,
41+
bip39::WordCount,
4242
};
4343
use bdk_wallet::miniscript::miniscript;
4444
use serde_json::json;

0 commit comments

Comments
 (0)