41 lines
1.1 KiB
Rust
41 lines
1.1 KiB
Rust
use clap::*;
|
|
fn main() {
|
|
let app = App::new("sclient")
|
|
.arg(Arg::with_name("pattern")
|
|
.long("pattern")
|
|
.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();
|
|
println!("{}",matches.value_of("pattern").unwrap());
|
|
}
|
|
|
|
// cargo run test
|
|
// cargo build
|
|
// cargo run -- --help
|
|
// target/debug/sclient --help
|
|
// target/debug/sclient --pattern=kevin
|
|
|
|
struct Cli {
|
|
pattern: String,
|
|
path: std::path::PathBuf,
|
|
}
|
|
// insecure := flag.Bool("k", false, "ignore bad TLS/SSL/HTTPS certificates")
|
|
// servername := flag.String("servername", "", "specify a servername different from <remote> (to disable SNI use an IP as <remote> and do use this option)")
|
|
// flag.BoolVar(insecure, "insecure", false, "ignore bad TLS/SSL/HTTPS certificates")
|
|
// flag.Parse()
|
|
// remotestr := flag.Arg(0)
|
|
// localstr := flag.Arg(1)
|