use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "git-cz", about = "Conventional commit tools")]
pub struct Opt {
#[structopt(short = "C", global = true)]
pub path: Option<PathBuf>,
#[structopt(short = "c", long = "config", global = true)]
pub config: Option<PathBuf>,
#[structopt(subcommand)]
pub cmd: Command,
}
#[derive(Debug, StructOpt)]
pub enum Command {
Check(CheckCommand),
Changelog(ChangelogCommand),
Version(VersionCommand),
Commit(CommitCommand),
}
#[derive(Debug, StructOpt)]
pub struct VersionCommand {
#[structopt(short, long, default_value = "v")]
pub prefix: String,
#[structopt(default_value = "HEAD")]
pub rev: String,
#[structopt(short, long)]
pub bump: bool,
#[structopt(short, long, conflicts_with_all(&["major", "minor", "patch"]))]
pub label: bool,
#[structopt(long)]
pub major: bool,
#[structopt(long)]
pub minor: bool,
#[structopt(long)]
pub patch: bool,
}
#[derive(Debug, StructOpt)]
pub struct CheckCommand {
#[structopt(default_value = "HEAD")]
pub rev: String,
}
#[derive(Debug, StructOpt)]
pub struct ChangelogCommand {
#[structopt(short, long, default_value = "v")]
pub prefix: String,
#[structopt(default_value = "HEAD")]
pub rev: String,
}
#[derive(Debug, StructOpt)]
pub struct CommitCommand {
#[structopt(long,
conflicts_with_all(&["feat", "build", "chore", "ci", "docs", "style", "refactor", "perf", "test"]),
)]
pub fix: bool,
#[structopt(long,
conflicts_with_all(&["fix", "build", "chore", "ci", "docs", "style", "refactor", "perf", "test"]),
)]
pub feat: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "chore", "ci", "docs", "style", "refactor", "perf", "test"]),
)]
pub build: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "build", "ci", "docs", "style", "refactor", "perf", "test"]),
)]
pub chore: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "build", "chore", "docs", "style", "refactor", "perf", "test"]),
)]
pub ci: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "build", "chore", "ci", "style", "refactor", "perf", "test"]),
)]
pub docs: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "build", "chore", "ci", "docs", "refactor", "perf", "test"]),
)]
pub style: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "build", "chore", "ci", "docs", "style", "perf", "test"]),
)]
pub refactor: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "build", "chore", "ci", "docs", "style", "refactor", "test"]),
)]
pub perf: bool,
#[structopt(long,
conflicts_with_all(&["feat", "fix", "build", "chore", "ci", "docs", "style", "refactor", "perf"]),
)]
pub test: bool,
#[structopt(long)]
pub breaking: bool,
#[structopt(last = true)]
pub extra_args: Vec<String>,
}