cron_when/cli/actions/
single.rs1use crate::output;
2use anyhow::Result;
3use tracing::{info, instrument};
4
5#[instrument(level = "info", fields(expression = %expression, verbose = %verbose, color = %color))]
11pub fn execute(expression: &str, verbose: bool, next: Option<u32>, color: bool) -> Result<()> {
12 if let Some(count) = next {
13 info!(iterations = count, "Displaying multiple iterations");
14 output::display_iterations(expression, count)?;
15 } else {
16 info!("Displaying single execution time");
17 output::display_single(expression, verbose, None, None, color)?;
18 }
19 Ok(())
20}