use std::path::PathBuf;
use clap::builder::{NonEmptyStringValueParser, PathBufValueParser};
use release_plz_core::ReleaseRequest;
use super::local_manifest;
#[derive(clap::Parser, Debug)]
pub struct Release {
#[clap(long, value_parser = PathBufValueParser::new())]
project_manifest: Option<PathBuf>,
#[clap(long)]
registry: Option<String>,
#[clap(long, value_parser = NonEmptyStringValueParser::new())]
token: Option<String>,
#[clap(long)]
pub dry_run: bool,
}
impl From<Release> for ReleaseRequest {
fn from(r: Release) -> Self {
ReleaseRequest {
local_manifest: local_manifest(r.project_manifest.as_deref()),
registry: r.registry,
token: r.token,
dry_run: r.dry_run,
}
}
}