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 | 2a27bd10c9f9f9294aa7f8264dae6fe00c629167 (patch) | |
tree | d12c1c25b2042e8871441568f5b380c7480e3a36 /imag-counter | |
parent | f88e3e629b1e1a0b6ed80c4e4efba704e56741c0 (diff) |
imag-counter: Remove setup code and use helper
Diffstat (limited to 'imag-counter')
-rw-r--r-- | imag-counter/src/main.rs | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/imag-counter/src/main.rs b/imag-counter/src/main.rs index 8eaa72d4..76dcc00c 100644 --- a/imag-counter/src/main.rs +++ b/imag-counter/src/main.rs @@ -25,7 +25,7 @@ extern crate libimagutil; use std::process::exit; use std::str::FromStr; -use libimagrt::runtime::Runtime; +use libimagrt::setup::generate_runtime_setup; use libimagcounter::counter::Counter; use libimagerror::trace::trace_error; use libimagutil::key_value_split::IntoKeyValue; @@ -50,20 +50,10 @@ enum Action { } fn main() { - let name = "imag-counter"; - let version = &version!()[..]; - let about = "Counter tool to count things"; - 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-counter", + &version!()[..], + "Counter tool to count things", + build_ui); rt.cli() .subcommand_name() |