added test code
This commit is contained in:
39
src/main.rs
39
src/main.rs
@@ -1,4 +1,41 @@
|
||||
extern crate clap;
|
||||
use clap::{Arg, App};
|
||||
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
let matches = App::new("gopherbridge")
|
||||
.version("0.1")
|
||||
.author("jali@orca-central.de")
|
||||
.about("a simple modular gopher server, that pushes converted web-content to a client")
|
||||
.arg(Arg::with_name("FORGROUND")
|
||||
.short("f")
|
||||
.long("foreground")
|
||||
.help("Keeps the service in the foreground")
|
||||
.takes_value(false))
|
||||
.arg(Arg::with_name("PLUGIN")
|
||||
.short("l")
|
||||
.long("plugins")
|
||||
.value_name("PLUGINLIST")
|
||||
.takes_value(true)
|
||||
.index(1))
|
||||
.arg(Arg::with_name("PORT")
|
||||
.short("p")
|
||||
.long("port")
|
||||
.help("Specifies the port the server listens on. Default is 70")
|
||||
.takes_value(false))
|
||||
.get_matches();
|
||||
|
||||
let pluginlist = matches.value_of("PLUGIN");
|
||||
let port = matches.value_of("PORT");
|
||||
|
||||
match pluginlist {
|
||||
None => println!("No plugin list"),
|
||||
Some => println!("Selected Plugins: {}",Some(pluginlist));
|
||||
}
|
||||
|
||||
match port {
|
||||
None => println!("Running on default port"),
|
||||
Some => println!("Port is {}",Some(port))
|
||||
}
|
||||
println!("{}",port);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user