(matches: &ArgMatches)
| 196 | } |
| 197 | |
| 198 | fn parse_thread_command(matches: &ArgMatches) -> Result<CliCommand, CliError> { |
| 199 | match matches.subcommand() { |
| 200 | Some(("crate-info", _)) => Ok(CliCommand::ThreadCrateInfo {}), |
| 201 | Some(("create", matches)) => Ok(CliCommand::ThreadCreate { |
| 202 | id: parse_string("id", matches)?, |
| 203 | kickoff_instruction: parse_instruction_file("kickoff_instruction", matches)?, |
| 204 | trigger: parse_trigger(matches)?, |
| 205 | }), |
| 206 | Some(("delete", matches)) => Ok(CliCommand::ThreadDelete { |
| 207 | id: parse_string("id", matches)?, |
| 208 | }), |
| 209 | Some(("get", matches)) => Ok(CliCommand::ThreadGet { |
| 210 | id: parse_string("id", matches).ok(), |
| 211 | address: parse_pubkey("address", matches).ok(), |
| 212 | }), |
| 213 | Some(("pause", matches)) => Ok(CliCommand::ThreadPause { |
| 214 | id: parse_string("id", matches)?, |
| 215 | }), |
| 216 | Some(("resume", matches)) => Ok(CliCommand::ThreadResume { |
| 217 | id: parse_string("id", matches)?, |
| 218 | }), |
| 219 | Some(("reset", matches)) => Ok(CliCommand::ThreadReset { |
| 220 | id: parse_string("id", matches)?, |
| 221 | }), |
| 222 | Some(("update", matches)) => Ok(CliCommand::ThreadUpdate { |
| 223 | id: parse_string("id", matches)?, |
| 224 | rate_limit: parse_u64("rate_limit", matches).ok(), |
| 225 | schedule: parse_string("schedule", matches).ok(), |
| 226 | }), |
| 227 | _ => Err(CliError::CommandNotRecognized( |
| 228 | matches.subcommand().unwrap().0.into(), |
| 229 | )), |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | fn parse_registry_command(matches: &ArgMatches) -> Result<CliCommand, CliError> { |
| 234 | match matches.subcommand() { |
no test coverage detected