(
root: &clap::Command,
key: &str,
argv: &[OsString],
display: &str,
)
| 486 | } |
| 487 | |
| 488 | fn 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 | |
| 512 | fn has_explicit_empty_value( |
| 513 | root: &clap::Command, |
no test coverage detected