use clap::{Args, Parser, Subcommand};
use std::path::PathBuf;
#[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 {
#[clap(subcommand)]
pub command: Commands,
}
#[derive(Debug, Subcommand)]
pub enum Commands {
#[clap(alias = "n")]
New(New),
#[clap(alias = "i")]
Init(Init),
#[clap(alias = "su")]
Setup(Setup),
#[clap(alias = "s")]
Stage(Stage),
#[clap(alias = "u")]
Unstage(Unstage),
#[clap(alias = "c")]
Commit(Commit),
#[clap(alias = "ca")]
CommitAll(CommitAll),
}
#[derive(Debug, Args)]
pub struct New {
#[clap(value_parser)]
pub name: String,
#[clap(value_parser)]
pub path: Option<PathBuf>,
}
#[derive(Debug, Args)]
pub struct Init {
#[clap(value_parser, default_value_t = String::from("git"))]
pub vcs: String,
}
#[derive(Debug, Args)]
pub struct Setup {
#[clap(value_parser, default_value_t = String::from("git"))]
pub vcs: String,
}
#[derive(Debug, Args)]
pub struct Stage {
#[clap(short, long, value_parser, required = false, default_value_t = false)]
pub dry_run: bool,
}
#[derive(Debug, Args)]
pub struct Unstage {
#[clap(short, long, value_parser, required = false, default_value_t = false)]
pub dry_run: bool,
}
#[derive(Debug, Args)]
pub struct Commit {
#[clap(short, long, value_parser, required = false, default_value_t = false)]
pub dry_run: bool,
}
#[derive(Debug, Args)]
pub struct CommitAll {
#[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,
}