1use crate::{Format, Runnable};
2use anyhow::Result;
3use clap::Parser;
4
5mod disable;
6mod enable;
7mod rescan;
8mod status;
9
10pub use self::{disable::*, enable::*, rescan::*, status::*};
11
12#[derive(Parser, Debug)]
18#[allow(clippy::doc_markdown)]
19pub struct QuotaCommand {
20 #[clap(subcommand)]
21 pub subcommand: QuotaSubcommand,
22}
23
24impl Runnable for QuotaCommand {
25 fn run(&self, format: Format, dry_run: bool) -> Result<()> {
26 match &self.subcommand {
27 QuotaSubcommand::Enable(cmd) => cmd.run(format, dry_run),
28 QuotaSubcommand::Disable(cmd) => cmd.run(format, dry_run),
29 QuotaSubcommand::Rescan(cmd) => cmd.run(format, dry_run),
30 QuotaSubcommand::Status(cmd) => cmd.run(format, dry_run),
31 }
32 }
33}
34
35#[derive(Parser, Debug)]
36pub enum QuotaSubcommand {
37 Enable(QuotaEnableCommand),
38 Disable(QuotaDisableCommand),
39 Rescan(QuotaRescanCommand),
40 Status(QuotaStatusCommand),
41}