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

Commit dc311a7

Browse files
committed
update owner_address_arg to use parser instead of validator
1 parent 58e0441 commit dc311a7

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
@@ -274,17 +274,6 @@ impl TryFrom<CliAuthorityType> for AuthorityType {
274274
}
275275

276276
pub fn owner_address_arg<'a>() -> Arg<'a> {
277-
Arg::with_name(OWNER_ADDRESS_ARG.name)
278-
.long(OWNER_ADDRESS_ARG.long)
279-
.takes_value(true)
280-
.value_name("OWNER_ADDRESS")
281-
.validator(|s| is_valid_pubkey(s))
282-
.help(OWNER_ADDRESS_ARG.help)
283-
}
284-
285-
// Temporary function that uses proper parsing to minimize commit size
286-
// TODO: use this to replace `owner_address_arg`
287-
pub fn owner_address_arg_temp<'a>() -> Arg<'a> {
288277
Arg::with_name(OWNER_ADDRESS_ARG.name)
289278
.long(OWNER_ADDRESS_ARG.long)
290279
.takes_value(true)
@@ -1239,7 +1228,7 @@ pub fn app<'a>(
12391228
"Lock the owner of this token account from ever being changed"
12401229
),
12411230
)
1242-
.arg(owner_address_arg_temp())
1231+
.arg(owner_address_arg())
12431232
.nonce_args(true)
12441233
)
12451234
.subcommand(
@@ -1798,7 +1787,7 @@ pub fn app<'a>(
17981787
.help("Specify the token account to close \
17991788
[default: owner's associated token account]"),
18001789
)
1801-
.arg(owner_address_arg_temp())
1790+
.arg(owner_address_arg())
18021791
.arg(multisig_signer_arg())
18031792
.nonce_args(true)
18041793
.offline_args(),
@@ -1852,7 +1841,7 @@ pub fn app<'a>(
18521841
.required_unless("address")
18531842
.help("Token of associated account. To query a specific account, use the `--address` parameter instead"),
18541843
)
1855-
.arg(owner_address_arg_temp().conflicts_with("address"))
1844+
.arg(owner_address_arg().conflicts_with("address"))
18561845
.arg(
18571846
Arg::with_name("address")
18581847
.value_parser(SignerSourceParserBuilder::default().allow_all().build())
@@ -1916,7 +1905,7 @@ pub fn app<'a>(
19161905
"Print token account addresses only"
19171906
),
19181907
)
1919-
.arg(owner_address_arg_temp())
1908+
.arg(owner_address_arg())
19201909
)
19211910
.subcommand(
19221911
SubCommand::with_name(CommandName::Address.into())
@@ -1932,7 +1921,7 @@ pub fn app<'a>(
19321921
[Default: return the client keypair address]")
19331922
)
19341923
.arg(
1935-
owner_address_arg_temp()
1924+
owner_address_arg()
19361925
.requires("token")
19371926
.help("Return the associated token address for the given owner. \
19381927
[Default: return the associated token address for the client keypair]"),
@@ -2382,7 +2371,7 @@ pub fn app<'a>(
23822371
.required(true)
23832372
.help("Specify the address of the account to send lamports to"),
23842373
)
2385-
.arg(owner_address_arg_temp())
2374+
.arg(owner_address_arg())
23862375
.arg(multisig_signer_arg())
23872376
)
23882377
.subcommand(

0 commit comments

Comments
 (0)