cron_when/cli/actions/crontab.rs
1use crate::{crontab, output};
2use anyhow::Result;
3use tracing::{info, instrument};
4
5/// Execute crontab parsing action
6///
7/// # Errors
8///
9/// Returns an error if crontab parsing or display fails
10#[instrument(level = "info", fields(verbose = %verbose, color = %color))]
11pub fn execute(verbose: bool, color: bool) -> Result<()> {
12 info!("Parsing current user's crontab");
13 let entries = crontab::parse_current()?;
14 output::display_entries(&entries, verbose, color)?;
15 Ok(())
16}