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)]
18pub struct QuotaCommand {
19 #[clap(subcommand)]
20 pub subcommand: QuotaSubcommand,
21}
22
23impl Runnable for QuotaCommand {
24 fn run(&self, format: Format, dry_run: bool) -> Result<()> {
25 match &self.subcommand {
26 QuotaSubcommand::Enable(cmd) => cmd.run(format, dry_run),
27 QuotaSubcommand::Disable(cmd) => cmd.run(format, dry_run),
28 QuotaSubcommand::Rescan(cmd) => cmd.run(format, dry_run),
29 QuotaSubcommand::Status(cmd) => cmd.run(format, dry_run),
30 }
31 }
32}
33
34#[derive(Parser, Debug)]
35pub enum QuotaSubcommand {
36 Enable(QuotaEnableCommand),
37 Disable(QuotaDisableCommand),
38 Rescan(QuotaRescanCommand),
39 Status(QuotaStatusCommand),
40}