scud 0.2.0

A secret library atm, woo woo.
use clap::{Args, Parser, Subcommand};
use std::path::PathBuf;

/// Secret project wooooooot.
#[derive(Debug, Parser)]
#[clap(name = "scud")]
#[clap(
    about = "The all-in-one tool for streamlining the many version control processes of your development workflow. Agnostic to your codebase's internals. It just works.",
    long_about = "Scud was created to fill the gap between the many version control processes of your development workflow and build upon the features provided by similar tools in the space (commitizen, cz cli, etc.), without compromising on performance. All commands support aliases thanks to clap to further accelerate your workflow.",
)]
#[clap(version)]
pub struct Cli {
    /// The subcommand to run.
    #[clap(subcommand)]
    pub command: Commands,
}

#[derive(Debug, Subcommand)]
pub enum Commands {
    /// Creates a new local repository in the current directory
    /// with a specified VCS, if one does not already exist.
    /// The default provider is Git.
    /// Additionally, initializes a corresponding remote repository
    /// with a specified source control provider.
    /// The default provider is GitHub.
    /// This command is useful for streamlining the entire process of
    /// creating a local repository for your given project/app/library
    /// and getting a remote repository up and running in a matter of seconds.
    /// Supports a variety of different combinations of VCS
    /// and source control providers.
    #[clap(alias = "n")]
    New(New),

    /// Initializes a local repository with a given VCS provider
    /// The default provider is Git.
    /// (currently supported: Git, SVN, CVS, Mercurial, Bazaar).
    /// This command is useful for initializing a repository that
    /// is not yet tracked by a particular Version Control System.
    #[clap(alias = "i")]
    Init(Init),

    /// Streamlines the setup process for various VCS providers
    /// and source control providers.
    /// This command is useful for quickly setting up various
    /// dependencies onto your local system
    /// (i.e. git, bazaar, gh, glab, etc.),
    /// so you can focus your time on more important things.
    #[clap(alias = "su")]
    Setup(Setup),

    /// Stages all modified files in the current local repository
    /// ensuring they are ready to be committed.
    #[clap(alias = "s")]
    Stage(Stage),

    /// Unstages all modified files in the current local repository
    /// so they are ready to be committed again.
    /// This command is useful for reverting changes made to files.
    #[clap(alias = "u")]
    Unstage(Unstage),

    /// Commits all staged files in the current local repository.
    /// This command is useful when you have reached a codebase state you
    /// want to remember
    #[clap(alias = "c")]
    Commit(Commit),

    /// Stages all modified files in the current local repository
    /// and then commits them.
    /// This command is useful for further streamlining the stage
    /// and commit process.
    #[clap(alias = "ca")]
    CommitAll(CommitAll),
}

/////////////////////////////////////////
// Arguments for the `new` subcommand. //
/////////////////////////////////////////

#[derive(Debug, Args)]
pub struct New {
    /// The name of the new project
    #[clap(value_parser)]
    pub name: String,

    /// The path to the new project
    #[clap(value_parser)]
    pub path: Option<PathBuf>,
}

//////////////////////////////////////////
// Arguments for the `init` subcommand. //
//////////////////////////////////////////

#[derive(Debug, Args)]
pub struct Init {
    /// The desired VCS provider (currently supported: Git, SVN, CVS, Mercurial, Bazaar)
    /// The default is Git.
    #[clap(value_parser, default_value_t = String::from("git"))]
    pub vcs: String,
}

///////////////////////////////////////////
// Arguments for the `setup` subcommand. //
///////////////////////////////////////////

#[derive(Debug, Args)]
pub struct Setup {
    /// The desired VCS provider (currently supported: Git, SVN, CVS, Mercurial, Bazaar)
    /// The default is GitHub.
    #[clap(value_parser, default_value_t = String::from("git"))]
    pub vcs: String,
}

//////////////////////////////////////////
// Arguments for the `stage` subcommand. //
//////////////////////////////////////////

#[derive(Debug, Args)]
pub struct Stage {
    /// When true, will not stage files but will show expected output.
    /// (optional).
    /// [default: false]
    #[clap(short, long, value_parser, required = false, default_value_t = false)]
    pub dry_run: bool,
}

//////////////////////////////////////////
// Arguments for the `unstage` subcommand. //
//////////////////////////////////////////

#[derive(Debug, Args)]
pub struct Unstage {
    /// When true, will not unstage files but will show expected output.
    /// (optional).
    /// [default: false]
    #[clap(short, long, value_parser, required = false, default_value_t = false)]
    pub dry_run: bool,
}

////////////////////////////////////////////
// Arguments for the `commit` subcommand. //
////////////////////////////////////////////

#[derive(Debug, Args)]
pub struct Commit {
    // /// The commit message to use when committing.
    // /// (optional).
    // #[clap(short, long, value_parser, required = false)]
    // pub message: Option<String>,

    /// When true, will not commit staged files but will show expected output.
    /// (optional).
    /// [default: false]
    #[clap(short, long, value_parser, required = false, default_value_t = false)]
    pub dry_run: bool,
}

///////////////////////////////////////////////
// Arguments for the `commit-all` subcommand. //
///////////////////////////////////////////////

#[derive(Debug, Args)]
pub struct CommitAll {
    // /// The commit message to use when committing.
    // /// (optional).
    // #[clap(short, long, value_parser, required = false)]
    // pub message: Option<String>,

    /// When true, will not stage and commit all files but
    /// will show expected output.
    /// (optional).
    /// [default: false]
    #[clap(short, long, value_parser, required = false, default_value_t = false)]
    pub dry_run: bool,
}

pub enum VCSKind {
    Git,
    Mercurial,
    SVN,
    CVS,
    Bazaar,
}

pub struct VCS {
    pub kind: VCSKind,
    pub name: String,
}