pub struct CelpApp {
pub app_name: String,
/* private fields */
}Expand description
CelpApp: Thin wrapper around clap::Command. Allows creating a command line application
Fields§
§app_name: StringImplementations§
source§impl CelpApp
impl CelpApp
sourcepub fn ignore_errors(self, yes: bool) -> Self
pub fn ignore_errors(self, yes: bool) -> Self
see clap::Command
sourcepub fn disable_help_flag(self, yes: bool) -> Self
pub fn disable_help_flag(self, yes: bool) -> Self
see clap::Command
sourcepub fn allow_missing_positional(self, yes: bool) -> Self
pub fn allow_missing_positional(self, yes: bool) -> Self
see clap::Command
sourcepub fn arg(self, arg: Arg) -> Self
pub fn arg(self, arg: Arg) -> Self
see clap::Command
sourcepub fn init_logger(self, yes: bool) -> Self
pub fn init_logger(self, yes: bool) -> Self
sourcepub fn publish_app_info(self, app_info: AppInfo) -> Self
pub fn publish_app_info(self, app_info: AppInfo) -> Self
sourcepub fn get_matches(self) -> ArgMatches
pub fn get_matches(self) -> ArgMatches
Parses the command line parameters and propagates the matches
§Example
use celp_sdk::util::celp_app::{build_app_info, Arg, CelpApp};
let app_info = build_app_info("1.0.0").unwrap();
let matches = CelpApp::new("test")
.publish_app_info(app_info)
.arg(
Arg::new("test")
.short('t')
.long("test")
.help("Testing an additional variable")
.required(true)
)
.get_matches();
if let Some(t) = matches.get_one::<String>("test") {
println!("Test argument was set to \"{}\"", t);
}Auto Trait Implementations§
impl Freeze for CelpApp
impl !RefUnwindSafe for CelpApp
impl Send for CelpApp
impl Sync for CelpApp
impl Unpin for CelpApp
impl !UnwindSafe for CelpApp
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