use clap::{Parser, Subcommand}; use crate::commands::config_subcommand::*; #[derive(Parser)] #[command(name = "mdrs")] #[command(about = "MDRS Rust CLI client", long_about = None)] pub struct Cli { #[command(subcommand)] pub command: Commands, } #[derive(Subcommand)] pub enum Commands { /// Config management (create, update, list, delete) #[command(subcommand)] Config(ConfigSubcommand), Login { #[arg(short, long)] username: Option, #[arg(short, long)] password: Option, remote: String, }, /// Logout and remove cached credentials for a remote Logout { remote: String, }, Upload { #[arg(short, long)] recursive: bool, #[arg(short = 's', long)] skip_if_exists: bool, local_path: String, remote_path: String, }, Download { #[arg(short, long)] recursive: bool, #[arg(short = 's', long)] skip_if_exists: bool, #[arg(short = 'p', long)] password: Option, #[arg(short = 'e', long)] exclude: Vec, remote_path: String, local_path: String, }, Ls { remote_path: String, #[arg(short = 'p', long)] password: Option, #[arg(short = 'J', long = "json")] json: bool, #[arg(short = 'r', long)] recursive: bool, #[arg(short = 'q', long)] quiet: bool, }, Whoami { remote: String, }, Labs { remote: String, }, Chacl { /// Access level key: private, public, pw_open, cbs_open, 5kikan_open, /// cbs_or_pw_open, 5kikan_or_pw_open, storage access_level_key: String, #[arg(short, long)] recursive: bool, #[arg(short = 'p', long)] password: Option, remote_path: String, }, Metadata { #[arg(short = 'p', long)] password: Option, remote_path: String, }, Mkdir { remote_path: String, }, Rm { #[arg(short, long)] recursive: bool, remote_path: String, }, Mv { src_path: String, dest_path: String, }, Cp { #[arg(short, long)] recursive: bool, src_path: String, dest_path: String, }, /// Show metadata for a remote file FileMetadata { #[arg(short = 'p', long)] password: Option, remote_path: String, }, /// Show the version of this tool Version, /// Update this binary to the latest release #[command(name = "selfupdate")] SelfUpdate { /// Skip the confirmation prompt #[arg(short = 'y', long)] yes: bool, }, }