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

Function parse_thread_command

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

Source from the content-addressed store, hash-verified

196}
197
198fn 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
233fn parse_registry_command(matches: &ArgMatches) -> Result<CliCommand, CliError> {
234 match matches.subcommand() {

Callers 1

try_fromMethod · 0.85

Calls 5

parse_stringFunction · 0.85
parse_instruction_fileFunction · 0.85
parse_triggerFunction · 0.85
parse_pubkeyFunction · 0.85
parse_u64Function · 0.85

Tested by

no test coverage detected