From 77a6e35df9d7fa165fa51fcc0b46db30a2f904f0 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Thu, 13 Feb 2025 01:28:35 -0500 Subject: [PATCH 1/2] split args --- bin/katana/src/cli/init/slot.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/katana/src/cli/init/slot.rs b/bin/katana/src/cli/init/slot.rs index 573b072a75..ceb3ab5039 100644 --- a/bin/katana/src/cli/init/slot.rs +++ b/bin/katana/src/cli/init/slot.rs @@ -36,7 +36,7 @@ pub struct SlotArgs { /// /// where the total number of pairs determine how many paymaster accounts will be created. #[arg(requires_all = ["id", "slot"])] - #[arg(long = "slot.paymasters", value_delimiter = ' ')] + #[arg(long = "slot.paymasters", value_delimiter = ' ', num_args = 1..)] pub paymaster_accounts: Option>, } @@ -188,8 +188,9 @@ mod tests { "--id", "--slot", "--slot.paymasters", - // Must be in one argument because the shell splits the argument otherwise. - "0x1,0x2 0x1,0x3 0x1,0x4", + "0x1,0x2", + "0x1,0x3", + "0x1,0x4", ]); let paymasters = slot.paymaster_accounts.unwrap(); From ac0db6a8b009df652ef8a44b2e644b3cee1ca781 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Thu, 13 Feb 2025 01:34:07 -0500 Subject: [PATCH 2/2] update help message --- bin/katana/src/cli/init/slot.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/bin/katana/src/cli/init/slot.rs b/bin/katana/src/cli/init/slot.rs index ceb3ab5039..f3b5a15d46 100644 --- a/bin/katana/src/cli/init/slot.rs +++ b/bin/katana/src/cli/init/slot.rs @@ -21,22 +21,19 @@ pub struct SlotArgs { /// Specify the number of paymaster accounts to create. /// /// This argument accepts a list of values, where each value is a pair of public key and salt - /// separated by a comma. If more than one pair is provided, the double quotes are required to - /// prevent the shell from prematurely splitting the argument. + /// separated by a comma. /// /// For example: /// - /// ``` - /// --slot.paymasters 0x1,0x2 - /// ``` + /// 0x1,0x2 /// - /// ``` - /// --slot.paymasters "0x1,0x2 0x3,0x4 0x5,0x6" - /// ``` + /// multiple values can be provided by separating them with spaces: + /// + /// 0x1,0x2 0x3,0x4 0x5,0x6 /// /// where the total number of pairs determine how many paymaster accounts will be created. #[arg(requires_all = ["id", "slot"])] - #[arg(long = "slot.paymasters", value_delimiter = ' ', num_args = 1..)] + #[arg(long = "slot.paymasters", num_args = 1..)] pub paymaster_accounts: Option>, }