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(())
}