Skip to content

Commit 72f7b88

Browse files
authored
cli: Fix multisig parsing (#72)
* cli: Fix multisig parsing #### Problem As pointed out in #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. * Integrate review feedback
1 parent 79f4736 commit 72f7b88

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clients/cli/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ 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::<String>(name).ok().flatten() {
5252
let mut results = Vec::new();
5353
for (i, value) in values.enumerate() {
5454
let name = format!("{}-{}", name, i.saturating_add(1));

0 commit comments

Comments
 (0)