7947c3bae9
- 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>
36 lines
744 B
Rust
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,
|
|
}
|