This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
md-pdf-rs/src/args.rs

28 lines
742 B
Rust
Raw Normal View History

2017-07-12 14:01:52 +01:00
use clap::{App, AppSettings, ArgMatches};
2017-07-12 14:49:53 +01:00
#[cfg(test)]
use clap::Result;
2017-07-12 14:01:52 +01:00
fn build() -> App<'static, 'static> {
return App::new(crate_name!())
.bin_name("mdp")
.about(crate_description!())
.version(crate_version!())
.setting(AppSettings::SubcommandRequiredElseHelp)
.global_setting(AppSettings::VersionlessSubcommands)
.global_setting(AppSettings::ColoredHelp)
.global_setting(AppSettings::GlobalVersion)
.global_setting(AppSettings::StrictUtf8)
}
pub fn get_matches() -> ArgMatches<'static> {
return build().get_matches();
}
2017-07-12 14:49:53 +01:00
#[cfg(test)]
pub fn get_matches_for(args : Vec<String>) -> Result<ArgMatches<'static>> {
return build().get_matches_from_safe(args);
}