From 10bb4623717f0d1522685df8292d7341155bf1b7 Mon Sep 17 00:00:00 2001 From: Fontrodona Nicolas <nicolas.fontrodona@ens-lyon.fr> Date: Tue, 31 Jan 2023 14:52:26 +0100 Subject: [PATCH] src/main.rs: add restore module --- src/main.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 74f35c3..782321c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,6 +20,7 @@ mod prune; mod pull; mod push; mod remote; +mod restore; #[derive(Debug, Parser)] #[clap(name = "gblk")] @@ -106,9 +107,22 @@ enum Commands { /// This command can be used to push a repository using a remote Push(Push), /// This command can be used to pull a repository using a remote + /// + /// This commands pull a remote repository inside the folder .borg. Before + /// erasing the content of the .borg repostory, it's content is saved + /// inside .tmp/<PROJECT_DIR>_bkp where PROJECT_DIR is the folder name at + /// the root of your project. If something goes wrong, you can restore your + /// .borg folder with the command gblk restore. If everything is ok, remove + /// the content of the .tmp folder using gblk clean Pull(Pull), - /// This command clean the .tmp repository of the project folder + /// This command cleans the .tmp repository of the project folder Clean, + /// This command moves the borg folder .tmp/<PROJECT_DIR>_bkp folder into + /// .borg repository + /// + /// The purpose of this command is to be used if a pull command fails after + /// removing content inside the .borg folder + Restore, } #[derive(Debug, Args)] @@ -404,5 +418,8 @@ fn main() { Commands::Clean => { clean::clean(); } + Commands::Restore => { + restore::restore(); + } } } -- GitLab