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

Commit c283f66

Browse files
committed
update owner_address_arg to use parser instead of validator
1 parent 4f542e3 commit c283f66

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

token/cli/src/clap_app.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -272,17 +272,6 @@ impl TryFrom<CliAuthorityType> for AuthorityType {
272272
}
273273

274274
pub fn owner_address_arg<'a>() -> Arg<'a> {
275-
Arg::with_name(OWNER_ADDRESS_ARG.name)
276-
.long(OWNER_ADDRESS_ARG.long)
277-
.takes_value(true)
278-
.value_name("OWNER_ADDRESS")
279-
.validator(|s| is_valid_pubkey(s))
280-
.help(OWNER_ADDRESS_ARG.help)
281-
}
282-
283-
// Temporary function that uses proper parsing to minimize commit size
284-
// TODO: use this to replace `owner_address_arg`
285-
pub fn owner_address_arg_temp<'a>() -> Arg<'a> {
286275
Arg::with_name(OWNER_ADDRESS_ARG.name)
287276
.long(OWNER_ADDRESS_ARG.long)
288277
.takes_value(true)
@@ -1237,7 +1226,7 @@ pub fn app<'a>(
12371226
"Lock the owner of this token account from ever being changed"
12381227
),
12391228
)
1240-
.arg(owner_address_arg_temp())
1229+
.arg(owner_address_arg())
12411230
.nonce_args(true)
12421231
)
12431232
.subcommand(
@@ -1796,7 +1785,7 @@ pub fn app<'a>(
17961785
.help("Specify the token account to close \
17971786
[default: owner's associated token account]"),
17981787
)
1799-
.arg(owner_address_arg_temp())
1788+
.arg(owner_address_arg())
18001789
.arg(multisig_signer_arg())
18011790
.nonce_args(true)
18021791
.offline_args(),
@@ -1850,7 +1839,7 @@ pub fn app<'a>(
18501839
.required_unless("address")
18511840
.help("Token of associated account. To query a specific account, use the `--address` parameter instead"),
18521841
)
1853-
.arg(owner_address_arg_temp().conflicts_with("address"))
1842+
.arg(owner_address_arg().conflicts_with("address"))
18541843
.arg(
18551844
Arg::with_name("address")
18561845
.value_parser(SignerSourceParserBuilder::default().allow_all().build())
@@ -1914,7 +1903,7 @@ pub fn app<'a>(
19141903
"Print token account addresses only"
19151904
),
19161905
)
1917-
.arg(owner_address_arg_temp())
1906+
.arg(owner_address_arg())
19181907
)
19191908
.subcommand(
19201909
SubCommand::with_name(CommandName::Address.into())
@@ -1930,7 +1919,7 @@ pub fn app<'a>(
19301919
[Default: return the client keypair address]")
19311920
)
19321921
.arg(
1933-
owner_address_arg_temp()
1922+
owner_address_arg()
19341923
.requires("token")
19351924
.help("Return the associated token address for the given owner. \
19361925
[Default: return the associated token address for the client keypair]"),
@@ -2380,7 +2369,7 @@ pub fn app<'a>(
23802369
.required(true)
23812370
.help("Specify the address of the account to send lamports to"),
23822371
)
2383-
.arg(owner_address_arg_temp())
2372+
.arg(owner_address_arg())
23842373
.arg(multisig_signer_arg())
23852374
)
23862375
.subcommand(

0 commit comments

Comments
 (0)