use clap::{arg, command}; pub fn get_args() -> clap::ArgMatches { command!() .about("Git wrapper") .subcommand( command!("bootstrap") .about("Bootstrap a new repository from base repository") .arg(arg!( "Base repository").required(true)) .arg(arg!( "Repository name").required(true)) .arg(arg!(--verify "Verify scripts before running them")) .alias("bs"), ) .subcommand( command!("todo") .about("Show open TODOs in repository") .alias("t") .arg(arg!(-c --count "Only show TODO count")), ) .subcommand( command!("new") .about("Create a new branch") .arg(arg!( "Branch name").required(true)) .alias("n"), ) .subcommand( command!("revert") .about("Revert n commits into the past") .arg(arg!( "Number of commits")), ) .subcommand( command!("commit") .about("Commit current changes") .alias("c") .arg(arg!(-f --force "Force commit and skip any checks")) .arg(arg!(-a --all "Add all changed files to commit")) .arg( arg!(-d --done "Only allow commiting if no TODOs are present") .conflicts_with("force"), ) .arg( arg!(-i --interactive "Write interactive commit message with gitmoji standard") .conflicts_with("message"), ) .arg(arg!(-m --message "Commit message").required(false)), ) .subcommand( command!("remove") .about("Remove a branch") .arg(arg!( "Branch name").required(true)) .alias("r"), ) .subcommand( command!("branch") .about("Show branches or switch to one") .alias("b") .arg(arg!( "Branch name").required(false)), ) .subcommand( command!() .name("push") .about("Push to a remote") .arg(arg!(-f --force "Force push")), ) .subcommand( command!() .name("status") .about("Show git status") .alias("s") .alias("stat") .alias("stats"), ) .subcommand( command!() .name("add") .about("Add files to git") .alias("a") .arg(arg!( "File to add").required(true)), ) .subcommand( command!() .name("fetch") .about("Run git fetch --prune") .alias("f"), ) .subcommand(command!().name("pull").about("Run git pull --prune")) .subcommand( command!() .name("log") .about("Show git commit log") .alias("l"), ) .subcommand(command!().name("save").about("Create a WIP commit")) .get_matches() }