Files
himalaya/src/attachments/cli.rs
T
Clément DOUIN 8416a41f99 use std clients
2026-05-20 00:54:16 +02:00

36 lines
1020 B
Rust

use anyhow::Result;
use clap::Subcommand;
use pimalaya_cli::printer::Printer;
use crate::{
attachments::{download::AttachmentsDownloadCommand, list::AttachmentsListCommand},
cli::BackendArg,
config::{AccountConfig, Config},
};
/// List or download attachments carried by a single message.
///
/// Available wherever `messages get` is — that is, IMAP, JMAP and
/// Maildir. The active backend is selected by `--backend` (default
/// `auto`).
#[derive(Debug, Subcommand)]
pub enum AttachmentsCommand {
List(AttachmentsListCommand),
Download(AttachmentsDownloadCommand),
}
impl AttachmentsCommand {
pub fn execute(
self,
printer: &mut impl Printer,
config: Config,
account_config: AccountConfig,
backend: BackendArg,
) -> Result<()> {
match self {
Self::List(cmd) => cmd.execute(printer, config, account_config, backend),
Self::Download(cmd) => cmd.execute(printer, config, account_config, backend),
}
}
}