(matches: &ArgMatches)
| 172 | } |
| 173 | |
| 174 | fn parse_secret_command(matches: &ArgMatches) -> Result<CliCommand, CliError> { |
| 175 | match matches.subcommand() { |
| 176 | Some(("approve", matches)) => Ok(CliCommand::SecretApprove { |
| 177 | name: parse_string("name", matches)?, |
| 178 | delegate: parse_pubkey("delegate", matches)?, |
| 179 | }), |
| 180 | Some(("get", matches)) => Ok(CliCommand::SecretGet { |
| 181 | name: parse_string("name", matches)?, |
| 182 | }), |
| 183 | Some(("list", _matches)) => Ok(CliCommand::SecretList {}), |
| 184 | Some(("create", matches)) => Ok(CliCommand::SecretCreate { |
| 185 | name: parse_string("name", matches)?, |
| 186 | word: parse_string("word", matches)?, |
| 187 | }), |
| 188 | Some(("revoke", matches)) => Ok(CliCommand::SecretRevoke { |
| 189 | name: parse_string("name", matches)?, |
| 190 | delegate: parse_pubkey("delegate", matches)?, |
| 191 | }), |
| 192 | _ => Err(CliError::CommandNotRecognized( |
| 193 | matches.subcommand().unwrap().0.into(), |
| 194 | )), |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | fn parse_thread_command(matches: &ArgMatches) -> Result<CliCommand, CliError> { |
| 199 | match matches.subcommand() { |
no test coverage detected