2026-01-19 18:54:41 +11:00
|
|
|
use clap::{Args, Parser, Subcommand, ValueEnum};
|
2026-01-06 16:11:06 +07:00
|
|
|
|
2026-01-26 09:06:48 +11:00
|
|
|
use crate::{commands::connect::config_option::ConfigOptionCli, interactive_variable};
|
2026-01-20 19:02:54 +11:00
|
|
|
|
2026-01-06 16:11:06 +07:00
|
|
|
#[derive(Parser)]
|
|
|
|
|
#[command(version, about, long_about = None)]
|
|
|
|
|
pub struct Cli {
|
|
|
|
|
#[command(subcommand)]
|
|
|
|
|
pub command: Commands,
|
|
|
|
|
|
|
|
|
|
/// Specify data file path
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
pub data: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Subcommand)]
|
|
|
|
|
pub enum Commands {
|
2026-01-20 18:44:40 +11:00
|
|
|
/// Configures downpour endpoints
|
2026-01-25 21:04:03 +11:00
|
|
|
Connect {
|
2026-01-20 18:44:40 +11:00
|
|
|
#[arg(short, long)]
|
2026-01-26 09:06:48 +11:00
|
|
|
name: Option<String>,
|
2026-01-20 18:44:40 +11:00
|
|
|
#[command(subcommand)]
|
2026-01-20 19:02:54 +11:00
|
|
|
option: ConfigOptionCli,
|
2026-01-20 18:44:40 +11:00
|
|
|
},
|
2026-01-06 16:11:06 +07:00
|
|
|
/// Uploads new game version to depot
|
2026-01-26 09:06:48 +11:00
|
|
|
Upload {
|
|
|
|
|
#[clap(flatten)]
|
|
|
|
|
info: UploadInfoCli,
|
|
|
|
|
#[arg(short, long)]
|
|
|
|
|
/// Alias of a given connection
|
|
|
|
|
name: Option<String>,
|
|
|
|
|
},
|
2026-01-19 18:54:41 +11:00
|
|
|
}
|
2026-01-20 17:44:33 +11:00
|
|
|
|
2026-01-19 18:54:41 +11:00
|
|
|
#[derive(Args)]
|
|
|
|
|
pub struct UploadInfo {
|
2026-01-26 09:06:48 +11:00
|
|
|
pub path: String,
|
|
|
|
|
pub game_id: String,
|
|
|
|
|
pub version_id: String,
|
|
|
|
|
}
|
|
|
|
|
#[derive(Args)]
|
|
|
|
|
pub struct UploadInfoCli {
|
2026-01-20 08:31:45 +11:00
|
|
|
/// Relative path to new version files
|
2026-01-20 18:44:40 +11:00
|
|
|
#[arg(short, long, default_value_t = String::from("."))]
|
|
|
|
|
pub path: String,
|
2026-01-19 18:54:41 +11:00
|
|
|
/// ID of game to attach to
|
|
|
|
|
#[arg(short, long)]
|
2026-01-26 09:06:48 +11:00
|
|
|
pub game_id: Option<String>,
|
2026-01-19 18:54:41 +11:00
|
|
|
/// Version ID to attach to
|
|
|
|
|
#[arg(short, long)]
|
2026-01-26 09:06:48 +11:00
|
|
|
pub version_id: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
impl UploadInfoCli {
|
|
|
|
|
pub fn interactive_configure(self) -> UploadInfo {
|
|
|
|
|
let path = self.path;
|
|
|
|
|
interactive_variable!(self, game_id, "Game ID");
|
|
|
|
|
interactive_variable!(self, version_id, "Version ID");
|
|
|
|
|
UploadInfo {
|
|
|
|
|
path,
|
|
|
|
|
game_id,
|
|
|
|
|
version_id,
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-01-19 18:54:41 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(ValueEnum, Copy, Clone, Debug, PartialEq, Eq)]
|
|
|
|
|
pub enum UploadStyle {
|
|
|
|
|
S3,
|
2026-01-06 16:11:06 +07:00
|
|
|
}
|