From f5b046181d44b66b187f1743e1e622a1f0cf9a1e Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 18 May 2016 22:25:20 +0200 Subject: [PATCH] Add initial main() code --- imag-bookmark/src/main.rs | 41 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/imag-bookmark/src/main.rs b/imag-bookmark/src/main.rs index 8dfa94c0..55b0e8fa 100644 --- a/imag-bookmark/src/main.rs +++ b/imag-bookmark/src/main.rs @@ -7,11 +7,48 @@ extern crate libimagentrylink; extern crate libimagrt; extern crate libimagutil; +use libimagentrytag::ui::{get_add_tags, get_remove_tags}; +use libimagentrylink::internal::Link; + mod ui; -use ui:build_ui; +use ui::build_ui; fn main() { - println!("Hello, world!"); + let rt = generate_runtime_setup("imag-bookmark", + &version!()[..], + "Bookmark collection tool", + build_ui); + + rt.cli() + .subcommand_name() + .map(|name| { + debug!("Call {}", name); + match name { + "add" => add(&rt), + "collection" => collection(&rt), + "list" => list(&rt), + "remove" => remove(&rt), + _ => { + debug!("Unknown command"); // More error handling + }, + } + }); +} + +fn add(rt: &Runtime) { + unimplemented!() +} + +fn collection(rt: &Runtime) { + unimplemented!() +} + +fn list(rt: &Runtime) { + unimplemented!() +} + +fn remove(rt: &Runtime) { + unimplemented!() }