rtimelogger 0.8.8

A simple cross-platform CLI tool to track working hours, lunch breaks, and calculate surplus time
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::cli::parser::Commands;
use crate::config::Config;
use crate::core::backup::BackupLogic;
use crate::db::pool::DbPool;
use crate::errors::AppResult;

pub fn handle(cmd: &Commands, cfg: &Config) -> AppResult<()> {
    if let Commands::Backup { file, compress } = cmd {
        let mut pool = DbPool::new(&cfg.database)?;
        BackupLogic::backup(&mut pool, cfg, file, *compress)?;
    }

    Ok(())
}