pub struct BadArgs { /* private fields */ }
Expand description
The struct containing parsed argument information
Implementations§
Source§impl BadArgs
impl BadArgs
Sourcepub fn get<T>(&self) -> Option<&T::Content>where
T: CliArg,
pub fn get<T>(&self) -> Option<&T::Content>where
T: CliArg,
Get the content of an argument by providing the type of the argument
Examples found in repository?
examples/compiler.rs (line 10)
7fn main() {
8 let args = badargs::badargs!(OutFile, Force, OLevel);
9
10 let outfile = args.get::<OutFile>();
11 let force = args.get::<Force>();
12 let o_level = args.get::<OLevel>();
13
14 println!("output: {:?}", outfile);
15 println!("force: {:?}", force);
16 println!("o-level: {:?}", o_level);
17 println!("other args: {:?}", args.unnamed())
18}
Sourcepub fn unnamed(&self) -> &[String]
pub fn unnamed(&self) -> &[String]
Get all unnamed additional arguments
Examples found in repository?
examples/compiler.rs (line 17)
7fn main() {
8 let args = badargs::badargs!(OutFile, Force, OLevel);
9
10 let outfile = args.get::<OutFile>();
11 let force = args.get::<Force>();
12 let o_level = args.get::<OLevel>();
13
14 println!("output: {:?}", outfile);
15 println!("force: {:?}", force);
16 println!("o-level: {:?}", o_level);
17 println!("other args: {:?}", args.unnamed())
18}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BadArgs
impl !RefUnwindSafe for BadArgs
impl !Send for BadArgs
impl !Sync for BadArgs
impl Unpin for BadArgs
impl !UnwindSafe for BadArgs
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