use argh::FromArgs;
use gitoxide_core as core;
use std::path::PathBuf;
#[derive(FromArgs)]
#[argh(name = "gix-plumbing")]
pub struct Args {
#[argh(switch)]
pub version: bool,
#[argh(switch, short = 'v')]
pub verbose: bool,
#[argh(option, short = 't')]
pub threads: Option<usize>,
#[argh(subcommand)]
pub subcommand: SubCommands,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand)]
pub enum SubCommands {
PackVerify(PackVerify),
PackExplode(PackExplode),
IndexFromPack(IndexFromPack),
RemoteRefList(RemoteRefList),
PackReceive(PackReceive),
CommitGraphVerify(CommitGraphVerify),
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "pack-index-from-data")]
pub struct IndexFromPack {
#[argh(option, short = 'i')]
pub iteration_mode: Option<core::pack::index::IterationMode>,
#[argh(option, short = 'p')]
pub pack_path: Option<PathBuf>,
#[argh(positional)]
pub directory: Option<PathBuf>,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "remote-ref-list")]
pub struct RemoteRefList {
#[argh(option, short = 'p')]
pub protocol: Option<core::Protocol>,
#[argh(positional)]
pub url: String,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "pack-receive")]
pub struct PackReceive {
#[argh(option, short = 'p')]
pub protocol: Option<core::Protocol>,
#[argh(option, short = 'r')]
pub refs_directory: Option<PathBuf>,
#[argh(positional)]
pub url: String,
#[argh(positional)]
pub directory: Option<PathBuf>,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "pack-explode")]
pub struct PackExplode {
#[argh(switch)]
pub verify: bool,
#[argh(switch)]
pub delete_pack: bool,
#[argh(switch)]
pub sink_compress: bool,
#[argh(option, short = 'c')]
pub check: Option<core::pack::explode::SafetyCheck>,
#[argh(positional)]
pub pack_path: PathBuf,
#[argh(positional)]
pub object_path: Option<PathBuf>,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "pack-verify")]
pub struct PackVerify {
#[argh(switch)]
pub decode: bool,
#[argh(switch)]
pub re_encode: bool,
#[argh(option)]
pub algorithm: Option<core::pack::verify::Algorithm>,
#[argh(switch, short = 's')]
pub statistics: bool,
#[argh(positional)]
pub path: PathBuf,
}
#[derive(FromArgs, PartialEq, Debug)]
#[argh(subcommand, name = "commit-graph-verify")]
pub struct CommitGraphVerify {
#[argh(positional)]
pub path: PathBuf,
#[argh(switch, short = 's')]
pub statistics: bool,
}