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