40 lines
1.1 KiB

extern crate clap;
use clap::{Arg, App};
fn main() {
let app = App::new("hello-clap");
let iternum = Arg::with_name("n")
.help("You need to specify the max number of iterations.")
let funcatk = Arg::with_name("f")
.help("You need to specify the function to attack.")
let contractf = Arg::with_name("c")
.help("You need to specify the contract file's name.")
let app = app.arg(iternum);
let app = app.arg(funcatk);
let app = app.arg(contractf);
let matches = app.get_matches();
let iternumout = matches.value_of("iternum")
.expect("Required option.");
let funcatkout = matches.value_of("funcatk")
.expect("Required option.");
let contractfout = matches.value_of("contractf")
.expect("Required option.");
println!("Your options are: {} {} {}!", iternumout, funcatkout, contractfout);