archive
/
md-pdf-rs
Archived
1
Fork 0

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() {
println!("Hello, world!");
let matches = args::get_matches();
}