use crate::{config::Config, error::Result, habitica::StatsCache};
pub fn handle_exit(config: &Config) -> Result<()> {
let stats_path = config.stats_cache_path();
if let Some(cache) = StatsCache::load(&stats_path)? {
let messages = cache.get_diff_messages();
for message in messages {
println!("{}", message);
}
StatsCache::delete(&stats_path)?;
}
Ok(())
}
#[cfg(test)]
mod tests {
#[test]
fn test_exit_command_exists() {
}
}