mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 15:27:16 +00:00
Removed main.rs
This commit is contained in:
parent
11ea31c512
commit
946395167b
1 changed files with 0 additions and 38 deletions
38
src/main.rs
38
src/main.rs
|
@ -1,38 +0,0 @@
|
|||
extern crate clap;
|
||||
|
||||
use clap::{App, Arg};
|
||||
|
||||
fn main() {
|
||||
let matches = App::new("MyApp")
|
||||
.version("1.0")
|
||||
.author("Kevin K. <kbknapp@gmail.com")
|
||||
.about("Does awesome things")
|
||||
.arg(Arg::new("config")
|
||||
.short("c")
|
||||
.long("config")
|
||||
.required(true)
|
||||
.help("Sets a custom config file")
|
||||
.takes_value(true))
|
||||
.arg(Arg::new("output")
|
||||
.short("o")
|
||||
.long("output")
|
||||
.help("Sets an optional output file")
|
||||
.takes_value(true))
|
||||
.arg(Arg::new("debug")
|
||||
.short("d")
|
||||
.help("Turn debugging information on"))
|
||||
.get_matches();
|
||||
|
||||
if let Some(o) = matches.value_of("output") {
|
||||
println!("Value for output: {}", o);
|
||||
}
|
||||
|
||||
println!("Config file: {}", matches.value_of("config").unwrap());
|
||||
|
||||
if matches.is_present("debug") {
|
||||
println!("Debug mode on");
|
||||
}
|
||||
|
||||
println!("App is running...");
|
||||
println!("Done.");
|
||||
}
|
Loading…
Add table
Reference in a new issue