use anyhow::Result;
use clap::Subcommand;
use pimalaya_cli::printer::Printer;
use crate::{
account::context::Account,
mbox::{
client::MboxClient,
flag::{
add::MboxFlagAddCommand, list::MboxFlagListCommand, remove::MboxFlagRemoveCommand,
set::MboxFlagSetCommand,
},
},
};
#[derive(Debug, Subcommand)]
pub enum MboxFlagCommand {
List(MboxFlagListCommand),
Add(MboxFlagAddCommand),
Set(MboxFlagSetCommand),
Remove(MboxFlagRemoveCommand),
}
impl MboxFlagCommand {
pub fn execute(
self,
printer: &mut impl Printer,
account: &mut Account,
client: &mut MboxClient,
) -> Result<()> {
match self {
Self::List(cmd) => cmd.execute(printer, account),
Self::Add(cmd) => cmd.execute(printer, client),
Self::Set(cmd) => cmd.execute(printer, client),
Self::Remove(cmd) => cmd.execute(printer, client),
}
}
}