From: merge-script Date: Mon, 3 Nov 2025 08:47:27 +0000 (+0100) Subject: Merge bitcoindevkit/bdk-cli#224: fix(pretty-format): use `--pretty` in any position X-Git-Url: http://internal-gitweb-vhost/?a=commitdiff_plain;h=bdb57772ca30b06c5e68561bfded564cb0261c39;p=bdk-cli Merge bitcoindevkit/bdk-cli#224: fix(pretty-format): use `--pretty` in any position c475363939a5c354fd18732e31d6c2b7ed01f8a7 chore(clippy): clippy fixes (Vadim Anufriev) daebe537383ac17475ecbe6b9cdebc3a586ecb80 test(pretty): add tests for pretty option (Vadim Anufriev) 17a4dcae2b9b2cea18e27cb31c2da3d74863b93c fix(pretty): use pretty option in any position (Vadim Anufriev) Pull request description: ### Description Fix `--pretty` flag to work in any position by marking it as a global argument. Previously the flag only worked before subcommands (`bdk-cli --pretty key generate`) but failed after (`bdk-cli key generate --pretty`). ### Notes to the reviewers **Before the fix:** Works: ```bash -> % cargo run -- --pretty key generate +-------------+-----------------------------------------------------------------------------------------------------------------+ | Fingerprint | 3e68be40 | +-------------+-----------------------------------------------------------------------------------------------------------------+ | Mnemonic | wheat equip exhaust funny panic lend message champion slim derive alcohol differ | +-------------+-----------------------------------------------------------------------------------------------------------------+ | Xprv | tprv8ZgxMBicQKsPdmyStjLXkChBJnUa5DBVJY5J46C3qbe98623M9uqD9wrDtcSZe4hLCodZdKacuY8YPzrNWFUEUwSrpa12KiEBikwLTjiYWP | +-------------+-----------------------------------------------------------------------------------------------------------------+ ``` Doesn't work: ```bash -> % cargo run -- key generate --pretty error: unexpected argument '--pretty' found Usage: bdk-cli key generate [OPTIONS] For more information, try '--help'. ``` ## Changelog notice ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### Bugfixes: * [ ] This pull request breaks the existing API * [x] I've added tests to reproduce the issue which are now passing * [ ] I'm linking the issue being fixed by this PR ACKs for top commit: notmandatory: ACK c475363939a5c354fd18732e31d6c2b7ed01f8a7 tvpeter: tACK c475363939a5c354fd18732e31d6c2b7ed01f8a7 Tree-SHA512: 748860bf542b0da80407b0b15b068b6bb4a519913eec85251439a32e9d40ccec0af13edfd21ef4ab42f43d26e79e1996c958c9569955bb90f8d9033717aae792 --- bdb57772ca30b06c5e68561bfded564cb0261c39