imag-tag: Remove setup code and use helper

This commit is contained in:
Matthias Beyer 2016-05-18 19:06:05 +02:00
parent 77f9e5ae0e
commit 9c374528d9

View file

@ -12,6 +12,7 @@ extern crate libimagerror;
use std::process::exit; use std::process::exit;
use libimagrt::runtime::Runtime; use libimagrt::runtime::Runtime;
use libimagrt::setup::generate_runtime_setup;
use libimagentrytag::tagable::Tagable; use libimagentrytag::tagable::Tagable;
use libimagstore::storeid::build_entry_path; use libimagstore::storeid::build_entry_path;
use libimagerror::trace::trace_error; use libimagerror::trace::trace_error;
@ -21,20 +22,10 @@ mod ui;
use ui::build_ui; use ui::build_ui;
fn main() { fn main() {
let name = "imag-store"; let rt = generate_runtime_setup("imag-store",
let version = &version!()[..]; &version!()[..],
let about = "Direct interface to the store. Use with great care!"; "Direct interface to the store. Use with great care!",
let ui = build_ui(Runtime::get_default_cli_builder(name, version, about)); build_ui);
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 id = rt.cli().value_of("id").unwrap(); // enforced by clap let id = rt.cli().value_of("id").unwrap(); // enforced by clap
rt.cli() rt.cli()