cron_when/cli/actions/
file.rs

1use crate::{crontab, output};
2use anyhow::Result;
3use std::path::Path;
4use tracing::{info, instrument};
5
6/// Execute file parsing action
7#[instrument(level = "info", fields(path = %path.display(), verbose = %verbose, color = %color))]
8pub fn execute(path: &Path, verbose: bool, color: bool) -> Result<()> {
9    info!("Parsing crontab file");
10    let entries = crontab::parse_file(path)?;
11    output::display_entries(&entries, verbose, color)?;
12    Ok(())
13}