pub struct ParsedCommand<'a> {
pub path: Vec<&'a str>,
pub flags: BTreeMap<String, Vec<String>>,
pub positionals: Vec<&'a str>,
}Expand description
Result of parse_argv — a structured view of an argv vector
against a CommandTree. Embedders use this to dispatch handlers
without writing a parallel walker.
Single source of truth: the same tree that drives tab completion drives argv parsing. Add a flag → both completion and parsing pick it up. Add a subcommand → both reach it.
Fields§
§path: Vec<&'a str>Path through the tree resolved by argv. ["compute", "knn"]
for myapp compute knn .... Excludes the program name.
flags: BTreeMap<String, Vec<String>>Flags collected along the way. Multiple values per key when the flag was repeated. Boolean flags map to a single empty string entry.
positionals: Vec<&'a str>Positional arguments — anything that wasn’t consumed as a flag, flag value, or subcommand name.
Trait Implementations§
Source§impl<'a> Clone for ParsedCommand<'a>
impl<'a> Clone for ParsedCommand<'a>
Source§fn clone(&self) -> ParsedCommand<'a>
fn clone(&self) -> ParsedCommand<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for ParsedCommand<'a>
impl<'a> RefUnwindSafe for ParsedCommand<'a>
impl<'a> Send for ParsedCommand<'a>
impl<'a> Sync for ParsedCommand<'a>
impl<'a> Unpin for ParsedCommand<'a>
impl<'a> UnsafeUnpin for ParsedCommand<'a>
impl<'a> UnwindSafe for ParsedCommand<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more