use anyhow::Result;
use clap::Subcommand;
use pimalaya_cli::printer::Printer;
use crate::smtp::{client::SmtpClient, raw::SmtpRawCommand, send::SmtpSendCommand};
#[derive(Debug, Subcommand)]
#[command(rename_all = "kebab-case")]
pub enum SmtpCommand {
Send(SmtpSendCommand),
Raw(SmtpRawCommand),
}
impl SmtpCommand {
pub fn execute(self, printer: &mut impl Printer, client: &mut SmtpClient) -> Result<()> {
match self {
Self::Send(cmd) => cmd.execute(printer, client),
Self::Raw(cmd) => cmd.execute(printer, client),
}
}
}