pub struct ParsedArgs {
pub options: HashMap<String, Option<String>>,
pub additional_options: Vec<String>,
pub normal_args: Vec<String>,
}
Expand description
§Command Arg Parser
use parse_args
to parse arg
example:
let parsed_args = parse_args(env::args());
Output: ParsedArgs { options: { “-c”: Some( “true”, ), “-none”: None, }, additional_options: [ “–lol”, ], normal_args: [ “todo”, “add”, ], }
Fields§
§options: HashMap<String, Option<String>>
§additional_options: Vec<String>
§normal_args: Vec<String>
Implementations§
Source§impl ParsedArgs
impl ParsedArgs
pub fn do_with_option(&self, option: &str, func: impl FnOnce(&String))
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParsedArgs
impl RefUnwindSafe for ParsedArgs
impl Send for ParsedArgs
impl Sync for ParsedArgs
impl Unpin for ParsedArgs
impl UnwindSafe for ParsedArgs
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more