use crate::prelude::*;
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "gitfleet")]
#[command(about = "Git operations over the active git scope", long_about = None)]
#[command(version)]
pub struct Cli {
#[command(subcommand)]
pub command: Commands,
#[arg(short, long, global = true)]
pub verbose: bool,
#[arg(short = 'n', long, global = true)]
pub dry_run: bool,
}
#[derive(Subcommand, Debug)]
pub enum Commands {
Status,
Checkout {
branch: String,
#[arg(short, long)]
create: bool,
},
Pull {
#[arg(short, long)]
rebase: bool,
},
Push {
#[arg(short, long)]
force_with_lease: bool,
},
Create {
branch: String,
#[arg(short, long)]
from: Option<String>,
#[arg(short, long)]
push: bool,
},
Commit {
#[arg(short, long)]
message: String,
#[arg(short, long)]
push: bool,
#[arg(short = 'a', long)]
stage_all: bool,
#[arg(short = 'x', long = "exclude", value_name = "ALIAS")]
exclude: Vec<String>,
#[arg(short = 'i', long = "include", value_name = "ALIAS")]
include: Vec<String>,
},
Sync {
#[arg(short, long)]
init: bool,
#[arg(short, long)]
recursive: bool,
},
Delete {
branch: String,
#[arg(short, long)]
remote: bool,
#[arg(short, long)]
force: bool,
},
Fetch {
#[arg(short, long)]
all: bool,
},
Branch {
#[arg(short, long)]
all: bool,
},
Init {
#[arg(short, long)]
recursive: bool,
},
Diff {
#[arg(long)]
base: Option<String>,
#[arg(short, long, default_value = "diffs")]
output: String,
#[arg(short, long)]
staged: bool,
},
Stage,
MergeBack {
#[arg(short, long, default_value = "Pre-merge commit")]
message: String,
},
}