Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit bb05462

Browse files
committed
Rename --allow-empty-recipient to --allow-unfunded-recipient
1 parent 7316e0f commit bb05462

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

token/cli/src/main.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ fn command_transfer(
473473
sender: Pubkey,
474474
ui_amount: Option<f64>,
475475
recipient: Pubkey,
476-
allow_empty_recipient: bool,
476+
allow_unfunded_recipient: bool,
477477
fund_recipient: bool,
478478
mint_address: Option<Pubkey>,
479479
mint_decimals: Option<u8>,
@@ -524,9 +524,9 @@ fn command_transfer(
524524
.value
525525
.map(|account_data| account_data.owner);
526526

527-
if recipient_account_owner.is_none() && !allow_empty_recipient {
528-
return Err("Error: The recipient has no balance. \
529-
Add `--allow-empty-recipient` to complete the transfer \
527+
if recipient_account_owner.is_none() && !allow_unfunded_recipient {
528+
return Err("Error: The recipient address is not funded. \
529+
Add `--allow-unfunded-recipient` to complete the transfer \
530530
"
531531
.into());
532532
}
@@ -1412,11 +1412,17 @@ fn main() {
14121412
Otherwise assume the recipient address is a user wallet and transfer to \
14131413
the associated token account")
14141414
)
1415+
.arg(
1416+
Arg::with_name("allow_unfunded_recipient")
1417+
.long("allow-unfunded-recipient")
1418+
.takes_value(false)
1419+
.help("Complete the transfer even if the recipient address is not funded")
1420+
)
14151421
.arg(
14161422
Arg::with_name("allow_empty_recipient")
14171423
.long("allow-empty-recipient")
14181424
.takes_value(false)
1419-
.help("Complete the transfer even if the recipient account does not exist")
1425+
.hidden(true) // Deprecated, use --allow-unfunded-recipient instead
14201426
)
14211427
.arg(
14221428
Arg::with_name("fund_recipient")
@@ -1944,13 +1950,14 @@ fn main() {
19441950
pubkey_of_signer(arg_matches, MINT_ADDRESS_ARG.name, &mut wallet_manager).unwrap();
19451951
let mint_decimals = value_of::<u8>(&arg_matches, MINT_DECIMALS_ARG.name);
19461952
let fund_recipient = matches.is_present("fund_recipient");
1947-
let allow_empty_recipient = matches.is_present("allow_empty_recipient");
1953+
let allow_unfunded_recipient = matches.is_present("allow_empty_recipient")
1954+
|| matches.is_present("allow_unfunded_recipient");
19481955
command_transfer(
19491956
&config,
19501957
sender,
19511958
amount,
19521959
recipient,
1953-
allow_empty_recipient,
1960+
allow_unfunded_recipient,
19541961
fund_recipient,
19551962
mint_address,
19561963
mint_decimals,

0 commit comments

Comments
 (0)