diff options
author | koverstreet <kent.overstreet@gmail.com> | 2024-02-09 14:20:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-09 14:20:29 -0500 |
commit | 9e6d9560d070bc14e1498a24ef6634d2b99f7e84 (patch) | |
tree | bfbfb68abcf2caee31707e6b1a3f977528017e63 | |
parent | a95a25dc1d21ae50de150f8ea9a2d409415dbb3b (diff) | |
parent | 4327e0681b205b52a045005f66541205401cf7b0 (diff) |
Merge pull request #236 from ErrorNoInternet/subcommand-aliases
Add a few subcommand aliases
-rw-r--r-- | src/commands/cmd_completions.rs | 2 | ||||
-rw-r--r-- | src/commands/cmd_list.rs | 2 | ||||
-rw-r--r-- | src/commands/cmd_subvolume.rs | 8 | ||||
-rw-r--r-- | src/commands/mod.rs | 1 |
4 files changed, 9 insertions, 4 deletions
diff --git a/src/commands/cmd_completions.rs b/src/commands/cmd_completions.rs index 53cdd643..81ee719f 100644 --- a/src/commands/cmd_completions.rs +++ b/src/commands/cmd_completions.rs @@ -3,7 +3,7 @@ use clap_complete::{generate, Generator, Shell}; use std::io; /// Generate shell completions -#[derive(clap::Parser, Debug)] +#[derive(Parser, Debug)] pub struct Cli { shell: Shell, } diff --git a/src/commands/cmd_list.rs b/src/commands/cmd_list.rs index 63eba7e9..442fdd62 100644 --- a/src/commands/cmd_list.rs +++ b/src/commands/cmd_list.rs @@ -113,7 +113,7 @@ pub struct Cli { mode: Mode, /// Check (fsck) the filesystem first - #[arg(short, long, default_value_t=false)] + #[arg(short, long)] fsck: bool, /// Force color on/off. Default: autodetect tty diff --git a/src/commands/cmd_subvolume.rs b/src/commands/cmd_subvolume.rs index a3176f40..c77eaacd 100644 --- a/src/commands/cmd_subvolume.rs +++ b/src/commands/cmd_subvolume.rs @@ -14,18 +14,22 @@ pub struct Cli { /// Subvolumes-related commands #[derive(Subcommand, Debug)] enum Subcommands { + #[command(visible_aliases = ["new"])] Create { /// Paths targets: Vec<PathBuf> }, + + #[command(visible_aliases = ["del"])] Delete { /// Path target: PathBuf }, - #[command(allow_missing_positional = true)] + + #[command(allow_missing_positional = true, visible_aliases = ["snap"])] Snapshot { /// Make snapshot read only - #[arg(long, short = 'r')] + #[arg(long, short)] read_only: bool, source: Option<PathBuf>, dest: PathBuf diff --git a/src/commands/mod.rs b/src/commands/mod.rs index 76de7f86..70fef82c 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -18,6 +18,7 @@ enum Subcommands { List(cmd_list::Cli), Mount(cmd_mount::Cli), Completions(cmd_completions::Cli), + #[command(visible_aliases = ["subvol"])] Subvolume(cmd_subvolume::Cli), } |