Skip to content
Snippets Groups Projects
Verified Commit 10bb4623 authored by nfontrod's avatar nfontrod
Browse files

src/main.rs: add restore module

parent 4d7f428c
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ mod prune; ...@@ -20,6 +20,7 @@ mod prune;
mod pull; mod pull;
mod push; mod push;
mod remote; mod remote;
mod restore;
#[derive(Debug, Parser)] #[derive(Debug, Parser)]
#[clap(name = "gblk")] #[clap(name = "gblk")]
...@@ -106,9 +107,22 @@ enum Commands { ...@@ -106,9 +107,22 @@ enum Commands {
/// This command can be used to push a repository using a remote /// This command can be used to push a repository using a remote
Push(Push), Push(Push),
/// This command can be used to pull a repository using a remote /// 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), Pull(Pull),
/// This command clean the .tmp repository of the project folder /// This command cleans the .tmp repository of the project folder
Clean, 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)] #[derive(Debug, Args)]
...@@ -404,5 +418,8 @@ fn main() { ...@@ -404,5 +418,8 @@ fn main() {
Commands::Clean => { Commands::Clean => {
clean::clean(); clean::clean();
} }
Commands::Restore => {
restore::restore();
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment