diff --git a/src/main.rs b/src/main.rs index 74f35c3de968f4b73735bfd2f8e551b8f33c81d4..782321c9a4fa927a87df565cf3529fed46463e44 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(); + } } }