2015-10-18 13:58:17 +00:00
|
|
|
#[macro_use] extern crate clap;
|
2015-10-26 19:53:12 +00:00
|
|
|
#[macro_use] extern crate log;
|
2015-11-09 17:33:44 +00:00
|
|
|
#[macro_use] extern crate serde;
|
2015-11-08 16:32:43 +00:00
|
|
|
#[macro_use] extern crate serde_json;
|
2015-11-20 14:33:40 +00:00
|
|
|
#[macro_use] extern crate glob;
|
2015-11-23 17:58:25 +00:00
|
|
|
#[macro_use] extern crate uuid;
|
2015-10-25 18:56:04 +00:00
|
|
|
#[macro_use] extern crate regex;
|
2015-11-30 18:05:29 +00:00
|
|
|
#[macro_use] extern crate prettytable;
|
2015-12-04 14:09:03 +00:00
|
|
|
extern crate url;
|
2015-10-26 22:51:44 +00:00
|
|
|
extern crate config;
|
2015-10-18 13:58:17 +00:00
|
|
|
|
2015-12-30 01:10:50 +00:00
|
|
|
pub use cli::CliConfig;
|
|
|
|
pub use configuration::Configuration;
|
|
|
|
pub use runtime::{ImagLogger, Runtime};
|
|
|
|
pub use clap::App;
|
|
|
|
pub use module::Module;
|
|
|
|
|
|
|
|
pub mod cli;
|
|
|
|
pub mod configuration;
|
|
|
|
pub mod runtime;
|
|
|
|
pub mod module;
|
|
|
|
pub mod storage;
|
|
|
|
pub mod ui;
|
|
|
|
pub mod util;
|
|
|
|
|
|
|
|
pub use module::bm::BM;
|
2015-12-20 15:32:18 +00:00
|
|
|
|
2015-10-18 13:58:17 +00:00
|
|
|
fn main() {
|
2015-12-30 17:50:09 +00:00
|
|
|
let yaml = load_yaml!("../etc/cli.yml");
|
|
|
|
let app = App::from_yaml(yaml);
|
|
|
|
let config = CliConfig::new(app);
|
2015-10-26 21:30:15 +00:00
|
|
|
let configuration = Configuration::new(&config);
|
2015-12-30 21:47:28 +00:00
|
|
|
ImagLogger::init(&configuration, &config);
|
2015-10-18 18:52:52 +00:00
|
|
|
|
2015-10-26 20:26:55 +00:00
|
|
|
debug!("Logger created!");
|
2015-11-27 18:24:58 +00:00
|
|
|
debug!("CliConfig : {:?}", &config);
|
|
|
|
debug!("Configuration: {:?}", &configuration);
|
|
|
|
|
2015-10-26 23:01:11 +00:00
|
|
|
let rt = Runtime::new(configuration, config);
|
2015-11-27 18:24:58 +00:00
|
|
|
|
|
|
|
debug!("Runtime : {:?}", &rt);
|
2015-10-18 18:52:52 +00:00
|
|
|
|
2015-10-25 18:56:04 +00:00
|
|
|
if let Some(matches) = rt.config.cli_matches.subcommand_matches("bm") {
|
2015-12-28 10:17:04 +00:00
|
|
|
let res = BM::new(&rt).exec(matches);
|
2015-12-20 11:43:57 +00:00
|
|
|
info!("BM exited with {}", res);
|
2015-10-25 18:56:04 +00:00
|
|
|
} else {
|
|
|
|
info!("No commandline call...")
|
|
|
|
}
|
2015-10-18 13:58:17 +00:00
|
|
|
}
|