53 lines
1.1 KiB
Rust
53 lines
1.1 KiB
Rust
use std::path::PathBuf;
|
|
|
|
use clap::{Args, Parser, Subcommand};
|
|
|
|
/// Deploy hobby projects from a local PC to a VPS over SSH.
|
|
#[derive(Debug, Parser)]
|
|
#[command(name = "xboct-deploy", version, about)]
|
|
pub struct Cli {
|
|
// Global flags
|
|
/// Use global config only
|
|
#[arg(short, long, global = true)]
|
|
pub global: bool,
|
|
|
|
/// Explicit path to the config file
|
|
#[arg(
|
|
short,
|
|
long,
|
|
value_name = "PATH",
|
|
global = true,
|
|
conflicts_with = "global"
|
|
)]
|
|
pub config: Option<PathBuf>,
|
|
|
|
/// Print planned steps without executing anything
|
|
#[arg(long)]
|
|
pub dry_run: bool,
|
|
|
|
#[command(subcommand)]
|
|
pub command: Option<Commands>,
|
|
}
|
|
|
|
#[derive(Subcommand, Debug)]
|
|
pub enum Commands {
|
|
/// Run deploy
|
|
Deploy(DeployArgs),
|
|
|
|
/// Interactive select project to deploy
|
|
Pick,
|
|
|
|
/// List all available projects
|
|
List,
|
|
|
|
/// List all available servers
|
|
ListServers,
|
|
}
|
|
|
|
#[derive(Args, Debug)]
|
|
pub struct DeployArgs {
|
|
/// Name of the project to deploy
|
|
#[arg(value_name = "PROJECT_NAME")]
|
|
pub project_name: Option<String>,
|
|
}
|