diff --git a/src/main.rs b/src/main.rs index 12d821a8f92fa83138eea263ac22082ed2b4474d..e0f0e6ca0bf4dd80815ff6206ba6f49a680986a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,6 +28,9 @@ enum Commands { /// Check if a checkout can be performed without losing data #[clap(name = "pre-co")] PreCo, + /// Checkout results to the current git commit + #[clap(alias = "co")] + Checkout(Checkout), } #[derive(Debug, Args)] @@ -52,6 +55,18 @@ struct List { archive: String, } +#[derive(Debug, Args)] +struct Checkout { + /// The checkout mode: hard or soft + /// + /// The hard mode will delete every file in your results folder and extract + /// those corresponding to the commit targeted by the checkout. + /// + /// The soft mode will only update files that existed in the targeted checkout + #[clap(short, long, default_value = "soft")] + mode: String, +} + fn main() { let args = Cli::parse(); @@ -68,5 +83,8 @@ fn main() { Commands::PreCo => { checkout::prepare_checkout(); } + Commands::Checkout(co) => { + checkout::checkout(&co.mode); + } } }