Add base arg parsing

This commit is contained in:
Jake Howard 2017-07-12 14:01:52 +01:00
parent 60835165fa
commit 529ed2b429
Signed by: jake
GPG key ID: 57AFB45680EDD477
2 changed files with 25 additions and 1 deletions

19
src/args.rs Normal file
View file

@ -0,0 +1,19 @@
use clap::{App, AppSettings, ArgMatches};
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();
}

View file

@ -1,3 +1,8 @@
#[macro_use]
extern crate clap;
mod args;
fn main() { fn main() {
println!("Hello, world!"); let matches = args::get_matches();
} }