Skip to content

Commit cf8e32a

Browse files
committed
cli: Fix multisig parsing
#### Problem As pointed out in solana-program#58, the CLI currently fails when just running `create-account <MINT_ADDRESS>`, because a multisig argument is expected during all commands. Clap v3's version of `values_of` gives an error if the arg is not configured in the command. This was probably missed during the port over to clap v3. #### Summary of changes Do the same thing as elsewhere, and change `values_of` to `try_get_many(...).ok().flatten()`. This is the last place using `values_of` in the CLI that could fail.
1 parent 769acd1 commit cf8e32a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clients/cli/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ fn signers_of(
4848
name: &str,
4949
wallet_manager: &mut Option<Rc<RemoteWalletManager>>,
5050
) -> Result<Option<SignersOf>, Box<dyn std::error::Error>> {
51-
if let Some(values) = matches.values_of(name) {
51+
if let Some(values) = matches.try_get_many(name).ok().flatten() {
5252
let mut results = Vec::new();
53-
for (i, value) in values.enumerate() {
53+
for (i, value) in values.copied().enumerate() {
5454
let name = format!("{}-{}", name, i.saturating_add(1));
5555
let signer = signer_from_path(matches, value, &name, wallet_manager)?;
5656
let signer_pubkey = signer.pubkey();

0 commit comments

Comments
 (0)