diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2016-05-18 19:06:05 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2016-05-18 22:57:04 +0200 |
commit | 04d66d269e753c97ee7eef6bf17996343ce73aca (patch) | |
tree | d1e29b3ada0f2757d173a84e296150a4287cca6c /imag-notes | |
parent | 2e94de2fcec6b3b3cfd9abb10a479c5caf5d32b4 (diff) |
imag-notes: Remove setup code and use helper
Diffstat (limited to 'imag-notes')
-rw-r--r-- | imag-notes/src/main.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/imag-notes/src/main.rs b/imag-notes/src/main.rs index 7e615afd..4dcaac34 100644 --- a/imag-notes/src/main.rs +++ b/imag-notes/src/main.rs @@ -12,6 +12,7 @@ use std::process::exit; use libimagrt::edit::Edit; use libimagrt::runtime::Runtime; +use libimagrt::setup::generate_runtime_setup; use libimagnotes::note::Note; use libimagerror::trace::trace_error; @@ -19,20 +20,10 @@ mod ui; use ui::build_ui; fn main() { - let name = "imag-notes"; - let version = &version!()[..]; - let about = "Note taking helper"; - 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-notes", + &version!()[..], + "Note taking helper", + build_ui); rt.cli() .subcommand_name() |