mod generate_completions;
mod release;
mod release_pr;
mod update;
use std::path::{Path, PathBuf};
use release_plz_core::CARGO_TOML;
use self::{
generate_completions::GenerateCompletions, release::Release, release_pr::ReleasePr,
update::Update,
};
#[derive(clap::Parser, Debug)]
#[command(about, version, author)]
pub struct CliArgs {
#[command(subcommand)]
pub command: Command,
#[arg(short, long)]
pub verbose: bool,
}
#[derive(clap::Subcommand, Debug)]
pub enum Command {
Update(Update),
ReleasePr(ReleasePr),
Release(Release),
GenerateCompletions(GenerateCompletions),
CheckUpdates,
}
fn local_manifest(project_manifest: Option<&Path>) -> PathBuf {
match project_manifest {
Some(manifest) => manifest.to_path_buf(),
None => std::env::current_dir()
.expect("cannot retrieve current directory")
.join(CARGO_TOML),
}
}