summary refs log tree commit diff stats
path: root/src/main.rs
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-08-27 19:57:56 -0400
committerBen Morrison <ben@gbmor.dev>2019-08-27 19:57:56 -0400
commit99273b69b161ae472f5ee37707d0a50ef5608be9 (patch)
treeaf2d76194846f2ad289d40147accac60365ca5df /src/main.rs
parent5b59ba3aee3e874b2e67cf529680d19910a3ec7d (diff)
downloadclinte-99273b69b161ae472f5ee37707d0a50ef5608be9.tar.gz
added subtype to db::Cmd. Fleshed out cli args.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 6c0d957..3f93d92 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,10 +1,31 @@
+use clap;
 use log::info;
 use std::sync::mpsc;
+use std::time;
 
 mod db;
 mod logging;
 
 fn main() {
+    let arg_matches = clap::App::new("clinte")
+        .version(clap::crate_version!())
+        .author("Ben Morrison (gbmor)")
+        .about("Command-line community notices system")
+        .subcommand(clap::SubCommand::with_name("list").about("Display notices"))
+        .subcommand(clap::SubCommand::with_name("post").about("Post a new notice"))
+        .subcommand(
+            clap::SubCommand::with_name("update")
+                .about("Update a notice you've posted")
+                .arg(clap::Arg::with_name("id").help("Numeric ID of the post")),
+        )
+        .subcommand(
+            clap::SubCommand::with_name("delete")
+                .about("Delete a notice you've posted")
+                .arg(clap::Arg::with_name("id").help("Numeric ID of the post")),
+        )
+        .get_matches();
+
+    let start = time::Instant::now();
     logging::init();
     info!("clinte starting up!");
     println!("clinte-0.1-dev");
@@ -13,5 +34,5 @@ fn main() {
     let (_tx, rx) = mpsc::channel::<db::Cmd>();
     let db = db::Conn::new(rx);
 
-    println!("{:?}", db);
+    info!("Startup completed in {:?}ms", start.elapsed().as_millis());
 }