MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / raw_option_value

Function raw_option_value

atomic-cli/src/agent_error.rs:488–510  ·  view source on GitHub ↗
(
    root: &clap::Command,
    key: &str,
    argv: &[OsString],
    display: &str,
)

Source from the content-addressed store, hash-verified

486}
487
488fn raw_option_value(
489 root: &clap::Command,
490 key: &str,
491 argv: &[OsString],
492 display: &str,
493) -> Option<OsString> {
494 let spellings = option_spellings(root, key, display);
495 let start = command_scope_start(root, key, argv);
496 for (index, token) in argv.iter().enumerate().skip(start) {
497 for spelling in &spellings {
498 if token == OsStr::new(spelling) {
499 return argv.get(index + 1).cloned();
500 }
501 if let Some(value) = attached_value(token, spelling) {
502 return Some(value);
503 }
504 }
505 if let Some(value) = short_cluster_value(root, key, argv, index, &spellings) {
506 return value;
507 }
508 }
509 None
510}
511
512fn has_explicit_empty_value(
513 root: &clap::Command,

Callers 1

has_explicit_empty_valueFunction · 0.85

Calls 7

option_spellingsFunction · 0.85
command_scope_startFunction · 0.85
attached_valueFunction · 0.85
short_cluster_valueFunction · 0.85
skipMethod · 0.80
getMethod · 0.65
iterMethod · 0.45

Tested by

no test coverage detected