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

Function has_explicit_empty_value

atomic-cli/src/agent_error.rs:512–530  ·  view source on GitHub ↗
(
    root: &clap::Command,
    key: &str,
    argv: &[OsString],
    arg: Option<&str>,
)

Source from the content-addressed store, hash-verified

510}
511
512fn has_explicit_empty_value(
513 root: &clap::Command,
514 key: &str,
515 argv: &[OsString],
516 arg: Option<&str>,
517) -> bool {
518 let Some(arg) = arg else {
519 return argv.iter().skip(1).any(|value| value.is_empty());
520 };
521 if arg.trim_start().starts_with('-') {
522 return raw_option_value(root, key, argv, arg)
523 .is_some_and(|value| value.as_os_str().is_empty());
524 }
525
526 let start = command_scope_start(root, key, argv);
527 argv.iter()
528 .skip(start)
529 .any(|value| value.as_os_str().is_empty())
530}
531
532fn write_ignoring_errors(mut writer: impl std::io::Write, output: &str) {
533 let _ = std::io::Write::write_all(&mut writer, output.as_bytes());

Callers 1

renderFunction · 0.85

Calls 5

raw_option_valueFunction · 0.85
command_scope_startFunction · 0.85
skipMethod · 0.80
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected