diff --git a/src/main.rs b/src/main.rs index f9e064a..82edba1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,20 +3,28 @@ fn main() { let app = App::new("sclient") .arg(Arg::with_name("pattern") .long("pattern") - .takes_value(true)); + .takes_value(true) + .required(true) + ) + .arg(Arg::with_name("servername") + .long("servername") + .takes_value(true) + .required(true) + ) + .arg(Arg::with_name("k") + .short("k") + .takes_value(true) + .required(true) + ); // println!("Hello, world!"); // let matches = app.get_matches(); - // let pattern = std::env::args().nth(1).expect("no pattern given"); - // let path = std::env::args().nth(2).expect("no path given"); - // let args = Cli { - // pattern: pattern, - // //path: std::path::PathBuf::from(path), - // }; println!("{}",matches.value_of("pattern").unwrap()); } // cargo run test +// cargo build +// cargo run -- --help // target/debug/sclient --help // target/debug/sclient --pattern=kevin