Use generate_runtime_setup() instead of doing it manually
This commit is contained in:
parent
b7f4b6317e
commit
053c5c13e8
1 changed files with 5 additions and 15 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue