Commit bdb5777
committed
Merge #224: fix(pretty-format): use
c475363 chore(clippy): clippy fixes (Vadim Anufriev)
daebe53 test(pretty): add tests for pretty option (Vadim Anufriev)
17a4dca 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 c475363
tvpeter:
tACK c475363
Tree-SHA512: 748860bf542b0da80407b0b15b068b6bb4a519913eec85251439a32e9d40ccec0af13edfd21ef4ab42f43d26e79e1996c958c9569955bb90f8d9033717aae792--pretty in any position3 files changed
+54
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1093 | 1093 | | |
1094 | 1094 | | |
1095 | 1095 | | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
| 1096 | + | |
| 1097 | + | |
1099 | 1098 | | |
1100 | 1099 | | |
1101 | 1100 | | |
| |||
1108 | 1107 | | |
1109 | 1108 | | |
1110 | 1109 | | |
1111 | | - | |
| 1110 | + | |
1112 | 1111 | | |
1113 | | - | |
1114 | | - | |
| 1112 | + | |
| 1113 | + | |
1115 | 1114 | | |
1116 | 1115 | | |
1117 | 1116 | | |
| |||
1162 | 1161 | | |
1163 | 1162 | | |
1164 | 1163 | | |
1165 | | - | |
| 1164 | + | |
1166 | 1165 | | |
1167 | 1166 | | |
1168 | | - | |
| 1167 | + | |
1169 | 1168 | | |
1170 | 1169 | | |
1171 | 1170 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments