Skip to content

Commit

Permalink
Fix pubkey-macro args (#34410)
Browse files Browse the repository at this point in the history
* Update macro to be a complete sentence

* Update punctuation/spaces to match new macro

* Remove repetitive 'address' usage and correct other verbiage

* Improve a couple withdrawal-recipient messages

* Fix wording

* Review comments
  • Loading branch information
Tyera authored Dec 12, 2023
1 parent 376b143 commit 636992b
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 67 deletions.
12 changes: 6 additions & 6 deletions cli/src/cluster_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
.index(1)
.value_name("OUR_VALIDATOR_PUBKEY")
.required(false),
"Identity pubkey of the validator"
"Identity of the validator."
))
.arg(
Arg::with_name("node_json_rpc_url")
Expand Down Expand Up @@ -297,8 +297,8 @@ impl ClusterQuerySubCommands for App<'_, '_> {
.about("Stream transaction logs")
.arg(pubkey!(
Arg::with_name("address").index(1).value_name("ADDRESS"),
"Account address to monitor [default: monitor all transactions except for \
votes] "
"Account to monitor \
[default: monitor all transactions except for votes]."
))
.arg(
Arg::with_name("include_votes")
Expand Down Expand Up @@ -347,13 +347,13 @@ impl ClusterQuerySubCommands for App<'_, '_> {
.index(1)
.value_name("VOTE_ACCOUNT_PUBKEYS")
.multiple(true),
"Only show stake accounts delegated to the provided vote accounts. "
"Only show stake accounts delegated to the provided vote account."
))
.arg(pubkey!(
Arg::with_name("withdraw_authority")
.value_name("PUBKEY")
.long("withdraw-authority"),
"Only show stake accounts with the provided withdraw authority. "
"Only show stake accounts with the provided withdraw authority."
)),
)
.subcommand(
Expand Down Expand Up @@ -430,7 +430,7 @@ impl ClusterQuerySubCommands for App<'_, '_> {
.index(1)
.value_name("ADDRESS")
.required(true),
"Account address"
"Account to query for transactions."
))
.arg(
Arg::with_name("limit")
Expand Down
2 changes: 1 addition & 1 deletion cli/src/inflation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl InflationSubCommands for App<'_, '_> {
.index(1)
.multiple(true)
.required(true),
"Address of account to query for rewards. "
"Account to query for rewards."
))
.arg(
Arg::with_name("rewards_epoch")
Expand Down
2 changes: 1 addition & 1 deletion cli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(clippy::arithmetic_side_effects)]
macro_rules! ACCOUNT_STRING {
() => {
r#", one of:
r#" Address is one of:
* a base58-encoded public key
* a path to a keypair file
* a hyphen; signals a JSON-encoded keypair on stdin
Expand Down
18 changes: 9 additions & 9 deletions cli/src/nonce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ impl NonceSubCommands for App<'_, '_> {
.index(1)
.value_name("NONCE_ACCOUNT_ADDRESS")
.required(true),
"Address of the nonce account. "
"Nonce account."
))
.arg(pubkey!(
Arg::with_name("new_authority")
.index(2)
.value_name("AUTHORITY_PUBKEY")
.required(true),
"Account to be granted authority of the nonce account. "
"Account to be granted authority of the nonce account."
))
.arg(nonce_authority_arg())
.arg(memo_arg())
Expand Down Expand Up @@ -94,7 +94,7 @@ impl NonceSubCommands for App<'_, '_> {
Arg::with_name(NONCE_AUTHORITY_ARG.name)
.long(NONCE_AUTHORITY_ARG.long)
.value_name("PUBKEY"),
"Assign noncing authority to another entity. "
"Assign noncing authority to this other entity."
))
.arg(
Arg::with_name("seed")
Expand All @@ -118,7 +118,7 @@ impl NonceSubCommands for App<'_, '_> {
.index(1)
.value_name("NONCE_ACCOUNT_ADDRESS")
.required(true),
"Address of the nonce account to display. "
"Nonce account to display."
)),
)
.subcommand(
Expand All @@ -129,7 +129,7 @@ impl NonceSubCommands for App<'_, '_> {
.index(1)
.value_name("NONCE_ACCOUNT_ADDRESS")
.required(true),
"Address of the nonce account. "
"Nonce account."
))
.arg(nonce_authority_arg())
.arg(memo_arg())
Expand All @@ -144,7 +144,7 @@ impl NonceSubCommands for App<'_, '_> {
.index(1)
.value_name("NONCE_ACCOUNT_ADDRESS")
.required(true),
"Address of the nonce account to display. "
"Nonce account to display."
))
.arg(
Arg::with_name("lamports")
Expand All @@ -161,14 +161,14 @@ impl NonceSubCommands for App<'_, '_> {
.index(1)
.value_name("NONCE_ACCOUNT_ADDRESS")
.required(true),
"Nonce account to withdraw from. "
"Nonce account to withdraw from."
))
.arg(pubkey!(
Arg::with_name("destination_account_pubkey")
.index(2)
.value_name("RECIPIENT_ADDRESS")
.required(true),
"The account to which the SOL should be transferred. "
"Recipient of withdrawn SOL."
))
.arg(
Arg::with_name("amount")
Expand All @@ -194,7 +194,7 @@ impl NonceSubCommands for App<'_, '_> {
.index(1)
.value_name("NONCE_ACCOUNT_ADDRESS")
.required(true),
"Nonce account to upgrade. "
"Nonce account to upgrade."
))
.arg(memo_arg())
.arg(compute_unit_price_arg()),
Expand Down
14 changes: 7 additions & 7 deletions cli/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ impl ProgramSubCommands for App<'_, '_> {
Arg::with_name("program_id")
.long("program-id")
.value_name("PROGRAM_ID"),
"Executable program's address, must be a keypair for initial deploys, \
can be a pubkey for upgrades [default: address of keypair at \
/path/to/program-keypair.json if present, otherwise a random address]"
"Executable program; must be a signer for initial deploys, \
can be an address for upgrades [default: address of keypair at \
/path/to/program-keypair.json if present, otherwise a random address]."
))
.arg(
Arg::with_name("final")
Expand Down Expand Up @@ -286,7 +286,7 @@ impl ProgramSubCommands for App<'_, '_> {
.long("new-buffer-authority")
.value_name("NEW_BUFFER_AUTHORITY")
.required(true),
"Address of the new buffer authority"
"New buffer authority."
)),
)
.subcommand(
Expand Down Expand Up @@ -382,7 +382,7 @@ impl ProgramSubCommands for App<'_, '_> {
.long("buffer-authority")
.value_name("AUTHORITY")
.conflicts_with("all"),
"Authority [default: the default configured keypair]"
"Authority [default: the default configured keypair]."
))
.arg(
Arg::with_name("lamports")
Expand Down Expand Up @@ -444,8 +444,8 @@ impl ProgramSubCommands for App<'_, '_> {
Arg::with_name("recipient_account")
.long("recipient")
.value_name("RECIPIENT_ADDRESS"),
"Address of the account to deposit the closed account's lamports \
[default: the default configured keypair]"
"Recipient of closed account's lamports \
[default: the default configured keypair]."
))
.arg(
Arg::with_name("lamports")
Expand Down
2 changes: 1 addition & 1 deletion cli/src/program_v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ impl ProgramV4SubCommands for App<'_, '_> {
.long("authority")
.value_name("AUTHORITY")
.conflicts_with("all"),
"Authority [default: the default configured keypair]"
"Authority [default: the default configured keypair]."
)),
)
.subcommand(
Expand Down
40 changes: 20 additions & 20 deletions cli/src/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl StakeSubCommands for App<'_, '_> {
Arg::with_name("custodian")
.long("custodian")
.value_name("PUBKEY"),
"Authority to modify lockups"
"Authority to modify lockups."
))
.arg(
Arg::with_name("seed")
Expand Down Expand Up @@ -308,14 +308,14 @@ impl StakeSubCommands for App<'_, '_> {
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"Stake account to delegate"
"Stake account to delegate."
))
.arg(pubkey!(
Arg::with_name("vote_account_pubkey")
.index(2)
.value_name("VOTE_ACCOUNT_ADDRESS")
.required(true),
"The vote account to which the stake will be delegated"
"Vote account to which the stake will be delegated."
))
.arg(stake_authority_arg())
.offline_args()
Expand All @@ -341,14 +341,14 @@ impl StakeSubCommands for App<'_, '_> {
.required(true),
"Existing delegated stake account that has been fully activated. On success \
this stake account will be scheduled for deactivation and the rent-exempt \
balance may be withdrawn once fully deactivated"
balance may be withdrawn once fully deactivated."
))
.arg(pubkey!(
Arg::with_name("vote_account_pubkey")
.index(2)
.value_name("REDELEGATED_VOTE_ACCOUNT_ADDRESS")
.required(true),
"The vote account to which the stake will be redelegated"
"Vote account to which the stake will be redelegated."
))
.arg(
Arg::with_name("redelegation_stake_account")
Expand Down Expand Up @@ -378,21 +378,21 @@ impl StakeSubCommands for App<'_, '_> {
.required(true)
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS"),
"Stake account in which to set a new authority. "
"Stake account in which to set a new authority."
))
.arg(pubkey!(
Arg::with_name("new_stake_authority")
.long("new-stake-authority")
.required_unless("new_withdraw_authority")
.value_name("PUBKEY"),
"New authorized staker"
"New authorized staker."
))
.arg(pubkey!(
Arg::with_name("new_withdraw_authority")
.long("new-withdraw-authority")
.required_unless("new_stake_authority")
.value_name("PUBKEY"),
"New authorized withdrawer. "
"New authorized withdrawer."
))
.arg(stake_authority_arg())
.arg(withdraw_authority_arg())
Expand Down Expand Up @@ -423,7 +423,7 @@ impl StakeSubCommands for App<'_, '_> {
.required(true)
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS"),
"Stake account in which to set a new authority. "
"Stake account in which to set a new authority."
))
.arg(
Arg::with_name("new_stake_authority")
Expand Down Expand Up @@ -470,7 +470,7 @@ impl StakeSubCommands for App<'_, '_> {
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"Stake account to be deactivated (or base of derived address if --seed is \
used). "
used)."
))
.arg(
Arg::with_name("seed")
Expand Down Expand Up @@ -507,7 +507,7 @@ impl StakeSubCommands for App<'_, '_> {
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"Stake account to split (or base of derived address if --seed is used). "
"Stake account to split (or base of derived address if --seed is used)."
))
.arg(
Arg::with_name("split_stake_account")
Expand Down Expand Up @@ -564,15 +564,15 @@ impl StakeSubCommands for App<'_, '_> {
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"Stake account to merge into"
"Stake account to merge into."
))
.arg(pubkey!(
Arg::with_name("source_stake_account_pubkey")
.index(2)
.value_name("SOURCE_STAKE_ACCOUNT_ADDRESS")
.required(true),
"Source stake account for the merge. If successful, this stake account will \
no longer exist after the merge"
"Source stake account for the merge. If successful, this stake account will \
no longer exist after the merge."
))
.arg(stake_authority_arg())
.offline_args()
Expand All @@ -590,14 +590,14 @@ impl StakeSubCommands for App<'_, '_> {
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"Stake account from which to withdraw (or base of derived address if --seed \
is used). "
is used)."
))
.arg(pubkey!(
Arg::with_name("destination_account_pubkey")
.index(2)
.value_name("RECIPIENT_ADDRESS")
.required(true),
"Recipient of withdrawn SOL"
"Recipient of withdrawn stake."
))
.arg(
Arg::with_name("amount")
Expand Down Expand Up @@ -637,7 +637,7 @@ impl StakeSubCommands for App<'_, '_> {
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"Stake account for which to set lockup parameters. "
"Stake account for which to set lockup parameters."
))
.arg(
Arg::with_name("lockup_epoch")
Expand All @@ -664,7 +664,7 @@ impl StakeSubCommands for App<'_, '_> {
Arg::with_name("new_custodian")
.long("new-custodian")
.value_name("PUBKEY"),
"Identity of a new lockup custodian. "
"New lockup custodian."
))
.group(
ArgGroup::with_name("lockup_details")
Expand Down Expand Up @@ -694,7 +694,7 @@ impl StakeSubCommands for App<'_, '_> {
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"Stake account for which to set lockup parameters. "
"Stake account for which to set lockup parameters."
))
.arg(
Arg::with_name("lockup_epoch")
Expand Down Expand Up @@ -754,7 +754,7 @@ impl StakeSubCommands for App<'_, '_> {
.index(1)
.value_name("STAKE_ACCOUNT_ADDRESS")
.required(true),
"The stake account to display. "
"Stake account to display."
))
.arg(
Arg::with_name("lamports")
Expand Down
Loading

0 comments on commit 636992b

Please sign in to comment.