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:05 +0200 |
commit | 77f9e5ae0e7b77853d6867ce4087f04eba59c89a (patch) | |
tree | e19e0b9e6e1931f38ac5d07450b4c6b5399527a9 /imag-store/src | |
parent | 04d66d269e753c97ee7eef6bf17996343ce73aca (diff) |
imag-store: Remove setup code and use helper
Diffstat (limited to 'imag-store/src')
-rw-r--r-- | imag-store/src/main.rs | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/imag-store/src/main.rs b/imag-store/src/main.rs index fd0a2c4d..6537687e 100644 --- a/imag-store/src/main.rs +++ b/imag-store/src/main.rs @@ -24,8 +24,7 @@ extern crate libimagstore; extern crate libimagutil; #[macro_use] extern crate libimagerror; -use libimagrt::runtime::Runtime; -use std::process::exit; +use libimagrt::setup::generate_runtime_setup; mod error; mod ui; @@ -42,20 +41,10 @@ use update::update; use delete::delete; fn main() { - let name = "imag-store"; - let version = &version!()[..]; - let about = "Direct interface to the store. Use with great care!"; - 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-store", + &version!()[..], + "Direct interface to the store. Use with great care!", + build_ui); rt.cli() .subcommand_name() |