Struct rsclp::CommandLineParserError
source · pub struct CommandLineParserError { /* private fields */ }Expand description
Command line option error representation. This struct is returned by all command line parser methods in case of error you can print its representation simply using {} placeholder in the rust macros
§Examples
use rsclp::CommandLineParser;
fn main() {
let mut clp = CommandLineParser::new(None);
let config_option = clp.add_string_option('c', "config", true, "file path", "configuration file path").unwrap();
match clp.parse_args(std::env::args()) {
Ok(()) => {
let config_file: String = clp.get_value(&config_option).unwrap();
println!("config_file: {}", config_file);
},
Err(parse_error) => {
eprintln!("{}", parse_error);
clp.show_help();
}
}
}Trait Implementations§
source§impl Debug for CommandLineParserError
impl Debug for CommandLineParserError
source§impl Display for CommandLineParserError
impl Display for CommandLineParserError
source§impl PartialEq for CommandLineParserError
impl PartialEq for CommandLineParserError
source§fn eq(&self, other: &CommandLineParserError) -> bool
fn eq(&self, other: &CommandLineParserError) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for CommandLineParserError
Auto Trait Implementations§
impl RefUnwindSafe for CommandLineParserError
impl Send for CommandLineParserError
impl Sync for CommandLineParserError
impl Unpin for CommandLineParserError
impl UnwindSafe for CommandLineParserError
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