Files
mdrs-client-rust/src/commands/config_subcommand.rs
T
orrisroot 7947c3bae9 feat(config): simplify list command and add subcommand aliases
- config list: remove --long option, always display URL
- config list: add ls alias (#[command(alias = "ls")])
- config delete: add rm and remove aliases (#[command(aliases = ["remove", "rm"])])
- README: update config list and config delete examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 18:59:18 +09:00

36 lines
744 B
Rust

use clap::{Args, Subcommand};
#[derive(Subcommand, Debug)]
pub enum ConfigSubcommand {
/// Create a new remote host
Create(ConfigCreateArgs),
/// Update an existing remote host
Update(ConfigUpdateArgs),
/// List all remote hosts
#[command(alias = "ls")]
List(ConfigListArgs),
/// Delete a remote host
#[command(aliases = ["remove", "rm"])]
Delete(ConfigDeleteArgs),
}
#[derive(Args, Debug)]
pub struct ConfigCreateArgs {
pub remote: String,
pub url: String,
}
#[derive(Args, Debug)]
pub struct ConfigUpdateArgs {
pub remote: String,
pub url: String,
}
#[derive(Args, Debug)]
pub struct ConfigListArgs {}
#[derive(Args, Debug)]
pub struct ConfigDeleteArgs {
pub remote: String,
}