]> Untitled Git - bdk-cli/commit
Merge bitcoindevkit/bdk-cli#224: fix(pretty-format): use `--pretty` in any position
authormerge-script <withtvpeter@gmail.com>
Mon, 3 Nov 2025 08:47:27 +0000 (09:47 +0100)
committermerge-script <withtvpeter@gmail.com>
Mon, 3 Nov 2025 08:47:27 +0000 (09:47 +0100)
commitbdb57772ca30b06c5e68561bfded564cb0261c39
treedfa9d58af8fd11543909be0abd735a02a16584fd
parenta3fcf8aa5440440ff8ca22bc5f522a8d892bd6df
parentc475363939a5c354fd18732e31d6c2b7ed01f8a7
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:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### 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'.
  ```

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ## Changelog notice

  <!-- Notice the release manager should include in the release tag message changelog -->
  <!-- See https://keepachangelog.com/en/1.0.0/ for examples -->

  ### 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