(matches: &ArgMatches)
| 241 | } |
| 242 | |
| 243 | fn parse_webhook_command(matches: &ArgMatches) -> Result<CliCommand, CliError> { |
| 244 | match matches.subcommand() { |
| 245 | Some(("get", matches)) => Ok(CliCommand::WebhookGet { |
| 246 | id: parse_string("id", matches)?.into_bytes(), |
| 247 | }), |
| 248 | Some(("create", matches)) => Ok(CliCommand::WebhookCreate { |
| 249 | body: parse_string("body", matches)?.into_bytes(), |
| 250 | id: parse_string("id", matches)?.into_bytes(), |
| 251 | method: parse_http_method("method", matches)?, |
| 252 | url: parse_string("url", matches)?, |
| 253 | }), |
| 254 | _ => Err(CliError::CommandNotRecognized( |
| 255 | matches.subcommand().unwrap().0.into(), |
| 256 | )), |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | fn parse_worker_command(matches: &ArgMatches) -> Result<CliCommand, CliError> { |
| 261 | match matches.subcommand() { |
no test coverage detected