pub struct ArgvOptions {
pub boolean: Booleans,
pub string: Vec<String>,
pub alias: Vec<(String, Vec<String>)>,
pub default: Vec<(String, Value)>,
pub stop_early: bool,
pub double_dash: bool,
pub unknown: Option<UnknownFn>,
pub camel_case: bool,
pub parse_boolean: bool,
}Expand description
Options for minimist and parse_argv.
Fields§
§boolean: BooleansBoolean flags.
string: Vec<String>Flags whose values are always kept as strings ("_" for positionals).
alias: Vec<(String, Vec<String>)>Alias groups: key -> other names.
default: Vec<(String, Value)>Default values (dotted keys allowed).
stop_early: boolStop parsing at the first positional argument.
double_dash: boolPut arguments after -- into "--" instead of "_".
unknown: Option<UnknownFn>Called for undeclared arguments.
camel_case: bool(parse_argv only) convert kebab-case keys to camelCase.
parse_boolean: bool(parse_argv only) turn "true"/"false" string values into booleans.
Implementations§
Source§impl ArgvOptions
impl ArgvOptions
Sourcepub fn all_boolean(self) -> Self
pub fn all_boolean(self) -> Self
Treat every long flag without = as boolean.
Sourcepub fn default_value(self, key: &str, value: impl Into<Value>) -> Self
pub fn default_value(self, key: &str, value: impl Into<Value>) -> Self
Add a default value.
Sourcepub fn stop_early(self) -> Self
pub fn stop_early(self) -> Self
Enable stop_early.
Sourcepub fn double_dash(self) -> Self
pub fn double_dash(self) -> Self
Enable the "--" key.
Sourcepub fn camel_case(self) -> Self
pub fn camel_case(self) -> Self
Enable camelCase keys (parse_argv).
Sourcepub fn parse_boolean(self) -> Self
pub fn parse_boolean(self) -> Self
Enable boolean parsing of values (parse_argv).
Trait Implementations§
Source§impl Clone for ArgvOptions
impl Clone for ArgvOptions
Source§impl Debug for ArgvOptions
impl Debug for ArgvOptions
Auto Trait Implementations§
impl Freeze for ArgvOptions
impl RefUnwindSafe for ArgvOptions
impl Send for ArgvOptions
impl Sync for ArgvOptions
impl Unpin for ArgvOptions
impl UnsafeUnpin for ArgvOptions
impl UnwindSafe for ArgvOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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