use crate::format::ir::{IrItem, IrType};
pub(crate) fn line(ir: &IrItem) -> String {
let IrItem { tt, lo } = ir;
match tt {
IrType::Ignore => "".into(),
IrType::Header(map) => format!(
"HEADER {}",
map.iter()
.map(|(k, v)| format!("{}={},", k, v))
.collect::<Vec<_>>()
.join("")
),
IrType::Start(time) => format!("START {}", time.to_string()),
IrType::Stop(time) => format!("STOP {}", time.to_string()),
IrType::Invoice(date) => format!("INVOICE {}", date.to_string()),
}
}
pub(crate) fn head_comment() -> String {
";; generated by cassiopeia, be careful about editing by hand!".into()
}