Evaluate birthdays
This commit is contained in:
parent
48faf910fd
commit
f1ff3f7aaa
3 changed files with 242 additions and 1 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -1,9 +1,13 @@
|
|||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
|
||||
use chrono::NaiveDate;
|
||||
use structopt::StructOpt;
|
||||
|
||||
use crate::eval::entries::DateRange;
|
||||
|
||||
mod commands;
|
||||
mod eval;
|
||||
mod format;
|
||||
mod parse;
|
||||
|
||||
|
|
@ -17,6 +21,13 @@ fn main() -> anyhow::Result<()> {
|
|||
let opt = Opt::from_args();
|
||||
let content = fs::read_to_string(&opt.file)?;
|
||||
let file = parse::parse(&opt.file, &content)?;
|
||||
print!("{}", file);
|
||||
let entries = eval::eval(
|
||||
&file,
|
||||
DateRange::new(
|
||||
NaiveDate::from_ymd(2021, 1, 1),
|
||||
NaiveDate::from_ymd(2021, 12, 31),
|
||||
),
|
||||
)?;
|
||||
println!("{:#?}", entries);
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue