use std::path::PathBuf;
use clap::{Args, Parser, Subcommand};
#[derive(Parser, Debug)]
#[command(name = "semver-sync", version, about, propagate_version = true)]
pub struct Cli {
#[command(subcommand)]
pub command: Option<Verb>,
}
#[derive(Subcommand, Debug)]
pub enum Verb {
Patch(Bump),
Minor(Bump),
Major(Bump),
Tag(Tag),
Set(Set),
Update,
Version,
Alias(Alias),
Completions(Completions),
Config(Config),
}
#[derive(Args, Debug)]
pub struct Bump {
#[arg(long)]
pub dry_run: bool,
}
#[derive(Args, Debug)]
pub struct Tag {
#[arg(value_name = "TAG")]
pub tag: String,
#[arg(long)]
pub dry_run: bool,
}
#[derive(Args, Debug)]
pub struct Set {
#[arg(id = "set-version", value_name = "VERSION")]
pub version: String,
#[arg(long)]
pub dry_run: bool,
}
#[derive(Args, Debug)]
pub struct Alias {
#[arg(long, default_value = "ss", value_name = "NAME")]
pub name: String,
#[arg(long, value_name = "FILE")]
pub file: Option<PathBuf>,
}
#[derive(Args, Debug)]
pub struct Completions {
#[arg(value_enum)]
pub shell: clap_complete::Shell,
}
#[derive(Args, Debug)]
pub struct Config {
#[arg(long)]
pub global: bool,
}