use clap::{Parser, Subcommand, ValueHint};
use clap_complete::Shell;
use std::path::PathBuf;
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
#[command(name = "khelp")]
#[command(about = "A tool to manage Kubernetes contexts")]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Commands>,
}
#[derive(Subcommand)]
pub enum Commands {
List,
Current,
Switch {
#[arg(value_hint = ValueHint::Other)]
context_name: Option<String>,
},
Edit {
#[arg(value_hint = ValueHint::Other)]
context_name: Option<String>,
},
Export {
#[arg(value_hint = ValueHint::Other, num_args = 0..)]
context_names: Vec<String>,
},
Delete {
#[arg(value_hint = ValueHint::Other)]
context_name: Option<String>,
#[arg(long)]
force: bool,
},
Cleanup {
#[arg(long)]
force: bool,
},
Rename {
#[arg(value_hint = ValueHint::Other)]
old_name: String,
#[arg(value_hint = ValueHint::Other)]
new_name: String,
},
Add {
#[arg(value_hint = ValueHint::FilePath)]
file_path: PathBuf,
#[arg(long)]
rename: bool,
#[arg(long)]
overwrite: bool,
#[arg(long)]
switch: bool,
},
Completions {
#[arg(value_enum)]
shell: Option<Shell>,
#[arg(long)]
install: bool,
},
#[cfg(feature = "self_update")]
Update {
#[arg(long)]
apply: bool,
},
}