MCPcopy Create free account
hub / github.com/clockwork-xyz/clockwork / parse_worker_command

Function parse_worker_command

cli/src/parser.rs:260–276  ·  view source on GitHub ↗
(matches: &ArgMatches)

Source from the content-addressed store, hash-verified

258}
259
260fn parse_worker_command(matches: &ArgMatches) -> Result<CliCommand, CliError> {
261 match matches.subcommand() {
262 Some(("create", matches)) => Ok(CliCommand::WorkerCreate {
263 signatory: parse_keypair_file("signatory_keypair", matches)?,
264 }),
265 Some(("get", matches)) => Ok(CliCommand::WorkerGet {
266 id: parse_u64("id", matches)?,
267 }),
268 Some(("update", matches)) => Ok(CliCommand::WorkerUpdate {
269 id: parse_u64("id", matches)?,
270 signatory: parse_keypair_file("signatory_keypair", matches).ok(),
271 }),
272 _ => Err(CliError::CommandNotRecognized(
273 matches.subcommand().unwrap().0.into(),
274 )),
275 }
276}
277
278// Arg parsers
279

Callers 1

try_fromMethod · 0.85

Calls 2

parse_keypair_fileFunction · 0.85
parse_u64Function · 0.85

Tested by

no test coverage detected