#![deny(missing_docs)]
#![deny(non_camel_case_types)]
#![cfg_attr(feature = "nightly", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]
#[macro_use]
extern crate clap;
extern crate env_logger;
extern crate ferru;
extern crate mustache;
use clap::{App, ArgMatches};
use ferru::Config;
fn main() {
env_logger::init()
.expect("Failed to initialize env_logger");
let yml = load_yaml!("../cli.yml");
let matches = App::from_yaml(yml).get_matches();
run(matches);
}
fn run(m: ArgMatches) {
if let (name, Some(sub_m)) = m.subcommand() {
let config = config_from_matches(sub_m);
match name {
"build" => ferru::build(&config).unwrap(),
_ => unreachable!(),
}
}
}
fn config_from_matches<'a>(matches: &'a ArgMatches) -> Config<'a> {
Config {
source_directory: matches.value_of("source"),
dest_directory: matches.value_of("destination"),
}
}