use std::path::PathBuf;
use clap::{Parser, Subcommand};
use crate::commands::alias::shell::Shell;
#[derive(Debug, Parser)]
#[command(
name = "lightshuttle",
version,
about = "Lightweight dev orchestrator for polyglot teams"
)]
pub(crate) struct Cli {
#[arg(long, short = 'f', global = true)]
pub(crate) file: Option<PathBuf>,
#[command(subcommand)]
pub(crate) command: Command,
}
#[derive(Debug, Subcommand)]
pub(crate) enum Command {
Up {
#[arg(long, default_value = "10s")]
grace: humantime::Duration,
#[arg(long, value_parser = clap::value_parser!(u16).range(1..))]
control_port: Option<u16>,
#[arg(long)]
no_otel: bool,
#[arg(long)]
env_file: Option<PathBuf>,
},
Down {
#[arg(long, default_value = "10s")]
grace: humantime::Duration,
},
Ps,
Logs {
resource: String,
#[arg(long, short = 'f')]
follow: bool,
},
Validate {
#[arg(long)]
strict: bool,
},
Manifest,
Restart {
resource: String,
#[arg(long)]
detach: bool,
},
Alias {
#[command(subcommand)]
action: AliasAction,
},
Export {
target: ExportTarget,
#[arg(long, short = 'o')]
output: Option<PathBuf>,
#[arg(long)]
force: bool,
},
Secrets {
#[command(subcommand)]
action: SecretsAction,
},
}
#[derive(Debug, Clone, Copy, clap::ValueEnum)]
pub(crate) enum ExportTarget {
Compose,
Kubernetes,
Helm,
}
#[derive(Debug, Subcommand)]
pub(crate) enum SecretsAction {
Check {
#[arg(long)]
env_file: Option<PathBuf>,
},
}
#[derive(Debug, Subcommand)]
pub(crate) enum AliasAction {
Install {
#[arg(long)]
shell: Option<Shell>,
#[arg(long)]
yes: bool,
},
Check {
#[arg(long)]
shell: Option<Shell>,
},
Uninstall {
#[arg(long)]
shell: Option<Shell>,
#[arg(long)]
yes: bool,
},
}