1use crate::{Format, Runnable};
2use anyhow::Result;
3use clap::Parser;
4
5mod get;
6mod list;
7mod set;
8
9use get::PropertyGetCommand;
10use list::PropertyListCommand;
11use set::PropertySetCommand;
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum)]
15pub enum PropertyObjectType {
16 Inode,
17 Subvol,
18 Filesystem,
19 Device,
20}
21
22#[derive(Parser, Debug)]
30pub struct PropertyCommand {
31 #[clap(subcommand)]
32 pub subcommand: PropertySubcommand,
33}
34
35impl Runnable for PropertyCommand {
36 fn run(&self, format: Format, dry_run: bool) -> Result<()> {
37 match &self.subcommand {
38 PropertySubcommand::Get(cmd) => cmd.run(format, dry_run),
39 PropertySubcommand::Set(cmd) => cmd.run(format, dry_run),
40 PropertySubcommand::List(cmd) => cmd.run(format, dry_run),
41 }
42 }
43}
44
45#[derive(Parser, Debug)]
46pub enum PropertySubcommand {
47 Get(PropertyGetCommand),
48 Set(PropertySetCommand),
49 List(PropertyListCommand),
50}