eureka_manager_cli/commands/
download.rs

1pub mod chapter;
2pub mod cover;
3pub mod manga;
4
5use clap::Subcommand;
6
7use super::{AsyncRun, AsyncRunContext};
8
9#[derive(Debug, Subcommand)]
10pub enum DownloadSubCommands {
11    /// Download Mangas subcommand
12    Manga(manga::MangaDownloadArgs),
13    /// Download Covers subcommand
14    Cover(cover::CoverDownloadArgs),
15    /// Download Chapters subcommand
16    Chapter(chapter::ChapterDownloadArgs),
17}
18
19impl AsyncRun for DownloadSubCommands {
20    async fn run(&self, ctx: AsyncRunContext) -> anyhow::Result<()> {
21        match self {
22            Self::Manga(r) => r.run(ctx).await,
23            Self::Cover(r) => r.run(ctx).await,
24            Self::Chapter(r) => r.run(ctx).await,
25        }
26    }
27}