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

Function parse_secret_command

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

Source from the content-addressed store, hash-verified

172}
173
174fn parse_secret_command(matches: &ArgMatches) -> Result<CliCommand, CliError> {
175 match matches.subcommand() {
176 Some(("approve", matches)) => Ok(CliCommand::SecretApprove {
177 name: parse_string("name", matches)?,
178 delegate: parse_pubkey("delegate", matches)?,
179 }),
180 Some(("get", matches)) => Ok(CliCommand::SecretGet {
181 name: parse_string("name", matches)?,
182 }),
183 Some(("list", _matches)) => Ok(CliCommand::SecretList {}),
184 Some(("create", matches)) => Ok(CliCommand::SecretCreate {
185 name: parse_string("name", matches)?,
186 word: parse_string("word", matches)?,
187 }),
188 Some(("revoke", matches)) => Ok(CliCommand::SecretRevoke {
189 name: parse_string("name", matches)?,
190 delegate: parse_pubkey("delegate", matches)?,
191 }),
192 _ => Err(CliError::CommandNotRecognized(
193 matches.subcommand().unwrap().0.into(),
194 )),
195 }
196}
197
198fn parse_thread_command(matches: &ArgMatches) -> Result<CliCommand, CliError> {
199 match matches.subcommand() {

Callers 1

try_fromMethod · 0.85

Calls 2

parse_stringFunction · 0.85
parse_pubkeyFunction · 0.85

Tested by

no test coverage detected