summaryrefslogtreecommitdiffstats
path: root/imag-todo
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2016-07-08 21:49:23 +0200
committerMatthias Beyer <mail@beyermatthias.de>2016-07-21 17:14:12 +0200
commit053c5c13e8ddc350fe36f725728ba8ffd5806453 (patch)
treec6f9359294770b57123cf6e6162a83a8618a737f /imag-todo
parentb7f4b6317ed47bdc1db241486f64af39e54c71aa (diff)
Use generate_runtime_setup() instead of doing it manually
Diffstat (limited to 'imag-todo')
-rw-r--r--imag-todo/src/main.rs20
1 files changed, 5 insertions, 15 deletions
diff --git a/imag-todo/src/main.rs b/imag-todo/src/main.rs
index cde6cf43..cf2453c9 100644
--- a/imag-todo/src/main.rs
+++ b/imag-todo/src/main.rs
@@ -21,6 +21,7 @@ use std::io::BufRead;
use task_hookrs::import::{import_task, import_tasks};
use libimagrt::runtime::Runtime;
+use libimagrt::setup::generate_runtime_setup;
use libimagtodo::task::IntoTask;
use libimagtodo::task::Task;
use libimagerror::trace::trace_error;
@@ -29,21 +30,10 @@ mod ui;
use ui::build_ui;
fn main() {
- let name = "imag-todo";
- let version = &version!()[..];
- let about = "Interface with taskwarrior";
- let ui = build_ui(Runtime::get_default_cli_builder(name, version, about));
-
- let rt = {
- let rt = Runtime::new(ui);
- if rt.is_ok() {
- rt.unwrap()
- } else {
- println!("Could not set up Runtime");
- println!("{:?}", rt.unwrap_err());
- exit(1);
- }
- };
+ let rt = generate_runtime_setup("imag-todo",
+ &version!()[..],
+ "Interface with taskwarrior",
+ build_ui);
match rt.cli().subcommand_name() {
Some("tw-hook") => tw_hook(&rt),