feat: add aliases for a few subcommands

This commit is contained in:
ErrorNoInternet 2024-02-09 17:37:00 +08:00
parent 428948e120
commit 4327e0681b
No known key found for this signature in database
GPG Key ID: 2486BFB7B1E6A4A3
2 changed files with 6 additions and 1 deletions

View File

@ -14,15 +14,19 @@ pub struct Cli {
/// Subvolumes-related commands /// Subvolumes-related commands
#[derive(Subcommand, Debug)] #[derive(Subcommand, Debug)]
enum Subcommands { enum Subcommands {
#[command(visible_aliases = ["new"])]
Create { Create {
/// Paths /// Paths
targets: Vec<PathBuf> targets: Vec<PathBuf>
}, },
#[command(visible_aliases = ["del"])]
Delete { Delete {
/// Path /// Path
target: PathBuf target: PathBuf
}, },
#[command(allow_missing_positional = true)]
#[command(allow_missing_positional = true, visible_aliases = ["snap"])]
Snapshot { Snapshot {
/// Make snapshot read only /// Make snapshot read only
#[arg(long, short)] #[arg(long, short)]

View File

@ -18,6 +18,7 @@ enum Subcommands {
List(cmd_list::Cli), List(cmd_list::Cli),
Mount(cmd_mount::Cli), Mount(cmd_mount::Cli),
Completions(cmd_completions::Cli), Completions(cmd_completions::Cli),
#[command(visible_aliases = ["subvol"])]
Subvolume(cmd_subvolume::Cli), Subvolume(cmd_subvolume::Cli),
} }