cuddle-please-frontend 0.1.0

A release-please inspired release manager tool, built on top of cuddle, but also useful standalone, cuddle-please supports, your ci of choice, as well as gitea, github
Documentation
use std::path::PathBuf;

use clap::Args;

use crate::stage0_config::{
    PleaseConfigBuilder, PleaseProjectConfigBuilder, PleaseSettingsConfigBuilder,
};

#[derive(Args, Debug, Clone)]
pub struct ConfigArgs {
    /// Which repository to publish against. If not supplied remote url will be inferred from environment or fail if not present.
    #[arg(
        env = "CUDDLE_PLEASE_API_URL",
        long,
        global = true,
        help_heading = "Config"
    )]
    pub api_url: Option<String>,

    /// repo is the name of repository you want to release for
    #[arg(
        env = "CUDDLE_PLEASE_REPO",
        long,
        global = true,
        help_heading = "Config"
    )]
    pub repo: Option<String>,

    /// owner is the name of user from which the repository belongs <user>/<repo>
    #[arg(
        env = "CUDDLE_PLEASE_OWNER",
        long,
        global = true,
        help_heading = "Config"
    )]
    pub owner: Option<String>,

    /// which source directory to use, if not set `std::env::current_dir` is used instead.
    #[arg(
        env = "CUDDLE_PLEASE_SOURCE",
        long,
        global = true,
        help_heading = "Config"
    )]
    pub source: Option<PathBuf>,

    /// which branch is being run from
    #[arg(
        env = "CUDDLE_PLEASE_BRANCH",
        long,
        global = true,
        help_heading = "Config"
    )]
    pub branch: Option<String>,

    /// which git username to use for commits
    #[arg(
        env = "CUDDLE_PLEASE_GIT_USERNAME",
        long,
        global = true,
        help_heading = "Config"
    )]
    pub git_username: Option<String>,

    /// which git email to use for commits
    #[arg(
        env = "CUDDLE_PLEASE_GIT_EMAIL",
        long,
        global = true,
        help_heading = "Config"
    )]
    pub git_email: Option<String>,
}

impl From<ConfigArgs> for PleaseConfigBuilder {
    fn from(value: ConfigArgs) -> Self {
        Self {
            project: Some(PleaseProjectConfigBuilder {
                owner: value.owner,
                repository: value.repo,
                source: value.source,
                branch: value.branch,
            }),
            settings: Some(PleaseSettingsConfigBuilder {
                api_url: value.api_url,
                git_username: value.git_username,
                git_email: value.git_email,
            }),
        }
    }
}