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

Function parse_trigger

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

Source from the content-addressed store, hash-verified

278// Arg parsers
279
280fn parse_trigger(matches: &ArgMatches) -> Result<Trigger, CliError> {
281 if matches.is_present("account") {
282 return Ok(Trigger::Account {
283 address: parse_pubkey("address", matches)?,
284 offset: 0, // TODO
285 size: 32, // TODO
286 });
287 } else if matches.is_present("cron") {
288 return Ok(Trigger::Cron {
289 schedule: parse_string("cron", matches)?,
290 skippable: true,
291 });
292 } else if matches.is_present("now") {
293 return Ok(Trigger::Now);
294 }
295
296 Err(CliError::BadParameter("trigger".into()))
297}
298
299fn parse_instruction_file(
300 arg: &str,

Callers 1

parse_thread_commandFunction · 0.85

Calls 2

parse_pubkeyFunction · 0.85
parse_stringFunction · 0.85

Tested by

no test coverage detected