pub(crate) enum Arg {
Short(char, bool, OsString),
Long(String, bool, OsString),
ArgWord(OsString),
Word(OsString),
PosWord(OsString),
}Expand description
Preprocessed command line argument
OsString in Short/Long correspond to orignal command line item used for errors
Variants§
Short(char, bool, OsString)
short flag: -f
bool indicates if following item is also part of this Short (created
Long(String, bool, OsString)
long flag: --flag
bool tells if it looks like –key=val or not
ArgWord(OsString)
“val” part of –key=val -k=val -kval
Word(OsString)
separate word that can be command, positional or a separate argument to a flag
Can start with - or --, doesn’t have to be valid utf8
hello
PosWord(OsString)
separate word that goes after --, strictly positional
Can start with - or --, doesn’t have to be valid utf8
Implementations§
Trait Implementations§
impl Eq for Arg
impl StructuralPartialEq for Arg
Auto Trait Implementations§
impl Freeze for Arg
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnwindSafe for Arg
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