Function klask::run_derived [−][src]
pub fn run_derived<C, F>(settings: Settings, f: F) where
C: IntoApp + FromArgMatches,
F: FnOnce(C),
Expand description
Can be used with a struct deriving [clap::Clap
]. Call with a closure that contains the code that would normally be in main
.
It’s just a wrapper over run_app
.
#[derive(Parser)]
struct Example {
#[clap(short)]
debug: bool,
}
klask::run_derived::<Example, _>(Settings::default(), |example|{
println!("{}", example.debug);
});