Skip to main content

resolve_flag

Function resolve_flag 

Source
pub fn resolve_flag(arg: &str) -> Result<Option<FlagTarget>, String>
Expand description

Resolve a --flag (with or without the leading dashes) to the schema path it addresses — canonicalizing ./_/- — or, for a dotted flag whose longest schema-path prefix is a free-form map, to that map plus the remaining segments as ONE entry key with its exact spelling (--intelligence_headers.x-team ⇒ path intelligence_headers, key x-team). Ok(None) when it is not a config path at all (the caller reports an unknown argument); Err when it names a config path but reaches into something that is not a map (an array element, a scalar).