use crate::gmail::GmailClient;
use crate::output::{OutputFormat, print_output};
use anyhow::Result;
use clap::Args;
#[derive(Args, Debug)]
pub struct HistoryArgs {
pub start_history_id: String,
#[arg(long)]
pub label_id: Option<String>,
#[arg(short, long, default_value = "100")]
pub max: usize,
#[arg(short, long, value_enum, default_value = "json")]
pub format: OutputFormat,
}
pub async fn handle_history_cmd(client: &GmailClient, args: HistoryArgs) -> Result<()> {
let history = client
.get_history(&args.start_history_id, args.label_id.as_deref(), args.max)
.await?;
print_output(&history, args.format)?;
Ok(())
}