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,
},
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,
},
}
#[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,
},
}