-
Notifications
You must be signed in to change notification settings - Fork 88
added single-letter aliases for top-level cli commands (issue #229) #231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chahat-101
wants to merge
2
commits into
bitcoindevkit:master
Choose a base branch
from
chahat-101:add-single-letter-aliases
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,13 +61,15 @@ pub struct CliOpts { | |
| /// Top level cli sub-commands. | ||
| #[derive(Debug, Subcommand, Clone, PartialEq)] | ||
| #[command(rename_all = "snake")] | ||
|
|
||
| pub enum CliSubCommand { | ||
| /// Wallet operations. | ||
| /// | ||
| /// bdk-cli wallet operations includes all the basic wallet level tasks. | ||
| /// Most commands can be used without connecting to any backend. To use commands that | ||
| /// needs backend like `sync` and `broadcast`, compile the binary with specific backend feature | ||
| /// and use the configuration options below to configure for that backend. | ||
| #[command(alias = "W")] | ||
| Wallet { | ||
| #[command(flatten)] | ||
| wallet_opts: WalletOpts, | ||
|
|
@@ -81,13 +83,14 @@ pub enum CliSubCommand { | |
| /// | ||
| /// These sub-commands are **EXPERIMENTAL** and should only be used for testing. Do not use this | ||
| /// feature to create keys that secure actual funds on the Bitcoin mainnet. | ||
| #[command(alias = "K")] | ||
| Key { | ||
| #[clap(subcommand)] | ||
| subcommand: KeySubCommand, | ||
| }, | ||
| /// Compile a miniscript policy to an output descriptor. | ||
| #[cfg(feature = "compiler")] | ||
| #[clap(long_about = "Miniscript policy compiler")] | ||
| #[command(alias = "C", long_about = "Miniscript policy compiler")] | ||
| Compile { | ||
| /// Sets the spending policy to compile. | ||
| #[arg(env = "POLICY", required = true, index = 1)] | ||
|
|
@@ -98,6 +101,7 @@ pub enum CliSubCommand { | |
| script_type: String, | ||
| }, | ||
| #[cfg(feature = "repl")] | ||
| #[command(alias = "R")] | ||
| /// REPL command loop mode. | ||
| /// | ||
| /// REPL command loop can be used to make recurring callbacks to an already loaded wallet. | ||
|
|
@@ -110,6 +114,7 @@ pub enum CliSubCommand { | |
| /// | ||
| /// Generate output descriptors from either extended key (Xprv/Xpub) or mnemonic phrase. | ||
| /// This feature is intended for development and testing purposes only. | ||
| #[command(alias = "D")] | ||
| Descriptor { | ||
| /// Descriptor type (script type) | ||
| #[arg( | ||
|
|
@@ -268,8 +273,10 @@ pub struct CompactFilterOpts { | |
| #[command(rename_all = "snake")] | ||
| pub enum OfflineWalletSubCommand { | ||
| /// Get a new external address. | ||
| #[command(alias = "new_addr")] | ||
| NewAddress, | ||
| /// Get the first unused external address. | ||
| #[command(alias = "unused_addr")] | ||
| UnusedAddress, | ||
| /// Lists the available spendable UTXOs. | ||
| Unspent, | ||
|
|
@@ -278,6 +285,7 @@ pub enum OfflineWalletSubCommand { | |
| /// Returns the current wallet balance. | ||
| Balance, | ||
| /// Creates a new unsigned transaction. | ||
| #[command(alias = "create")] | ||
| CreateTx { | ||
| /// Adds a recipient to the transaction. | ||
| // Clap Doesn't support complex vector parsing https://github.com/clap-rs/clap/issues/1704. | ||
|
|
@@ -326,6 +334,7 @@ pub enum OfflineWalletSubCommand { | |
| add_data: Option<String>, //base 64 econding | ||
| }, | ||
| /// Bumps the fees of an RBF transaction. | ||
| #[command(alias = "bump")] | ||
| BumpFee { | ||
| /// TXID of the transaction to update. | ||
| #[arg(env = "TXID", long = "txid")] | ||
|
|
@@ -354,6 +363,7 @@ pub enum OfflineWalletSubCommand { | |
| /// Returns the available spending policies for the descriptor. | ||
| Policies, | ||
| /// Returns the public version of the wallet's descriptor(s). | ||
| #[command(alias = "pub_desc")] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello @chahat-101 |
||
| PublicDescriptor, | ||
| /// Signs and tries to finalize a PSBT. | ||
| Sign { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I advice moving this section to below the
prettysection