use camino::Utf8PathBuf;
use clap::{Args, Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(name = "filelift", version, about)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
#[command(about = "Manage upload targets")]
#[command(subcommand)]
Target(TargetCommands),
#[command(about = "Upload a file or directory")]
Upload(UploadCommand),
#[command(about = "Manage diagnostic logs")]
#[command(subcommand)]
Log(LogCommands),
}
#[derive(Debug, Subcommand)]
pub enum TargetCommands {
#[command(about = "Add or update an upload target")]
Add(TargetAddCommand),
#[command(about = "List configured upload targets")]
List,
#[command(about = "Set the default upload target")]
Use(TargetUseCommand),
#[command(about = "Remove an upload target")]
Remove(TargetRemoveCommand),
}
#[derive(Debug, Subcommand)]
pub enum LogCommands {
#[command(about = "Export decrypted diagnostic logs")]
Export(LogExportCommand),
#[command(about = "Clear encrypted diagnostic logs")]
Clear,
}
#[derive(Debug, Args)]
pub struct LogExportCommand {
#[arg(long, default_value = "filelift-debug-log.jsonl")]
pub output: Utf8PathBuf,
}
#[derive(Debug, Args)]
pub struct TargetAddCommand {
pub name: String,
#[arg(long, default_value = "s3")]
pub provider: String,
#[arg(long)]
pub bucket: Option<String>,
#[arg(long)]
pub endpoint: Option<String>,
#[arg(long)]
pub region: Option<String>,
#[arg(long)]
pub public_base_url: Option<String>,
#[arg(long)]
pub access_key_id: Option<String>,
#[arg(long)]
pub secret_access_key: Option<String>,
#[arg(long)]
pub set_default: bool,
}
#[derive(Debug, Args)]
pub struct TargetUseCommand {
pub name: String,
}
#[derive(Debug, Args)]
pub struct TargetRemoveCommand {
pub name: String,
}
#[derive(Debug, Args)]
pub struct UploadCommand {
pub path: Utf8PathBuf,
#[arg(long)]
pub target: Option<String>,
#[arg(long)]
pub prefix: Option<String>,
#[arg(long)]
pub name: Option<String>,
#[arg(long)]
pub recursive: bool,
#[arg(long)]
pub markdown: bool,
#[arg(long)]
pub dry_run: bool,
}