Skip to content

Conversation

@va-an
Copy link
Contributor

@va-an va-an commented Oct 21, 2025

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:

-> % 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:

-> % 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:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo fmt and cargo clippy before committing

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

@va-an va-an changed the title fix(pretty): use --pretty in any position fix(pretty-format): use --pretty in any position Oct 21, 2025
@coveralls
Copy link

coveralls commented Oct 21, 2025

Pull Request Test Coverage Report for Build 18762217126

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+5.6%) to 14.43%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/handlers.rs 0 2 0.0%
Totals Coverage Status
Change from base Build 18520893551: 5.6%
Covered Lines: 172
Relevant Lines: 1192

💛 - Coveralls

Copy link
Member

@notmandatory notmandatory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK c475363

good idea!

Copy link
Collaborator

@tvpeter tvpeter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK c475363

@tvpeter tvpeter merged commit bdb5777 into bitcoindevkit:master Nov 3, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this to Done in BDK-CLI Nov 3, 2025
@va-an va-an deleted the fix/pretty-global-arg branch November 3, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants