Merge pull request #236 from ErrorNoInternet/subcommand-aliases

Add a few subcommand aliases
This commit is contained in:
koverstreet 2024-02-09 14:20:29 -05:00 committed by GitHub
commit 9e6d9560d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 4 deletions

View File

@ -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,
}

View File

@ -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

View File

@ -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

View File

@ -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),
}