rtimelogger 0.8.6

A simple cross-platform CLI tool to track working hours, lunch breaks, and calculate surplus time
Documentation
use crate::cli::parser::Commands;
use crate::config::Config;
use crate::db::pool::DbPool;
use crate::errors::AppResult;
use crate::export::ExportLogic;

pub fn handle(cmd: &Commands, cfg: &Config) -> AppResult<()> {
    if let Commands::Export {
        format,
        file,
        range,
        events,
        force,
    } = cmd
    {
        let mut pool = DbPool::new(&cfg.database)?;
        ExportLogic::export(&mut pool, format.clone(), file, range, *events, *force)?;
    }
    Ok(())
}