I never got around to implementing the create-and-upload behavior for the file attachment command. I'll do it later, but for now I'm disabling the code to quiet down the compiler warnings.
40 lines
917 B
Rust
40 lines
917 B
Rust
use clap::{Parser, Subcommand};
|
|
|
|
#[derive(Debug, Parser)]
|
|
#[command(version, about, long_about = None)]
|
|
pub struct Args {
|
|
#[arg(short = 'u', long = "url", env = "GTTOOL_GITEA_URL")]
|
|
pub gitea_url: String,
|
|
#[arg(short = 'r', long = "repo", env = "GTTOOL_FQRN")]
|
|
pub repo: String,
|
|
|
|
#[command(subcommand)]
|
|
pub command: Commands,
|
|
}
|
|
|
|
#[derive(Debug, Subcommand)]
|
|
pub enum Commands {
|
|
ListReleases,
|
|
CreateRelease {
|
|
#[arg()]
|
|
body: String,
|
|
#[arg(short, long)]
|
|
draft: bool,
|
|
#[arg()]
|
|
name: String,
|
|
#[arg()]
|
|
tag_name: String,
|
|
#[arg()]
|
|
target_commitish: String,
|
|
},
|
|
UploadRelease {
|
|
#[arg()]
|
|
tag_name: String,
|
|
// TODO: implement create-and-upload as a single command invocation
|
|
// #[arg(short, long)]
|
|
// create: bool,
|
|
#[arg()]
|
|
files: Vec<String>,
|
|
},
|
|
}
|