diff --git a/2018/src/lib.rs b/2018/src/lib.rs new file mode 100644 index 0000000..3955f73 --- /dev/null +++ b/2018/src/lib.rs @@ -0,0 +1,13 @@ +extern crate chrono; +#[macro_use] extern crate itertools; +extern crate regex; + +pub mod common; +pub mod day01; +pub mod day02; +pub mod day03; +pub mod day04; +pub mod day05; +pub mod day06; +pub mod day07; +pub mod day08; diff --git a/2018/src/main.rs b/2018/src/main.rs index 08e5e90..de8d0a7 100644 --- a/2018/src/main.rs +++ b/2018/src/main.rs @@ -1,23 +1,14 @@ extern crate chrono; extern crate clap; -#[macro_use] extern crate itertools; -extern crate regex; +extern crate aoc_2018; use std::fs; use std::io; use std::time::Instant; -use clap::{App, Arg}; +use aoc_2018::*; -pub mod common; -pub mod day01; -pub mod day02; -pub mod day03; -pub mod day04; -pub mod day05; -pub mod day06; -pub mod day07; -pub mod day08; +use clap::{App, Arg}; fn get_impl(day: &str) -> Box { match day.parse() { @@ -39,23 +30,23 @@ fn main() { .version("2018") .author("Bert Peters ") .arg(Arg::with_name("day") - .value_name("DAY") - .help("Number of the day to execute") - .required(true) - .takes_value(true)) + .value_name("DAY") + .help("Number of the day to execute") + .required(true) + .takes_value(true)) .arg(Arg::with_name("part2") - .short("2") - .help("Whether to run part 2") - .long("part2")) + .short("2") + .help("Whether to run part 2") + .long("part2")) .arg(Arg::with_name("input") - .short("i") - .long("input") - .help("Optional input file, stdin otherwise") - .takes_value(true)) + .short("i") + .long("input") + .help("Optional input file, stdin otherwise") + .takes_value(true)) .arg(Arg::with_name("time") - .short("t") - .long("time") - .help("Print the time for the result")) + .short("t") + .long("time") + .help("Print the time for the result")) .get_matches(); let mut implementation = get_impl(matches.value_of("day").unwrap());