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

Commit 0e31092

Browse files
committed
token-2022: add token 2022 argument to token cli for easy use
Instead of coping the token program id of the token22 program one can now just write: create-token -token22
1 parent c5b6874 commit 0e31092

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

token/cli/src/clap_app.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,12 @@ pub fn app<'a, 'b>(
656656
[default: randomly generated keypair]"
657657
),
658658
)
659+
.arg(
660+
Arg::with_name("program_2022")
661+
.value_name("TOKEN_22_PROGRAM_ID")
662+
.short("token22")
663+
.long("TokenProgram22")
664+
.help("Use token extension program token 2022 program id: TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"))
659665
.arg(
660666
Arg::with_name("mint_authority")
661667
.long("mint-authority")

token/cli/src/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ impl<'a> Config<'a> {
261261

262262
let default_program_id = spl_token::id();
263263
let (program_id, restrict_to_program_id) =
264-
if let Some(program_id) = value_of(matches, "program_id") {
264+
if matches.is_present("program_2022") {
265+
(spl_token_2022::id(), true)
266+
} else if let Some(program_id) = value_of(matches, "program_id") {
265267
(program_id, true)
266268
} else if !sign_only {
267269
if let Some(address) = value_of(matches, "token")

0 commit comments

Comments
 (0)