summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..2c7905f
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,29 @@
+#[macro_use]
+extern crate log;
+extern crate env_logger;
+extern crate clap;
+extern crate linoquotes_gamma;
+
+use clap::{App, Arg};
+
+fn main() {
+ let matches = App::new("linoquotes")
+ .version("3.0.0")
+ .author("Kjetil Ørbekk")
+ .about("Quote db for #linux.no. Run with \
+ RUST_LOG=linoquotes_gamma=info to enable logging.")
+ .arg(Arg::with_name("port")
+ .short("p").long("port").takes_value(true)
+ .help("Port to serve on"))
+ .get_matches();
+
+ let port = matches
+ .value_of("port")
+ .unwrap_or("8080")
+ .parse::<u16>()
+ .expect("port number");
+
+ env_logger::init().unwrap();
+ info!("Starting");
+ linoquotes_gamma::server::serve(port);
+}