Skip to content
Snippets Groups Projects
Commit 0c79ba22 authored by nfontrod's avatar nfontrod
Browse files

src/main.rs: add pre-co command

parent d3a8d2da
No related branches found
No related tags found
No related merge requests found
use clap::{Args, Parser, Subcommand}; use clap::{Args, Parser, Subcommand};
mod checkout;
mod commit; mod commit;
mod init; mod init;
mod list; mod list;
...@@ -24,6 +25,9 @@ enum Commands { ...@@ -24,6 +25,9 @@ enum Commands {
Commit(Commit), Commit(Commit),
/// List the content of the .borg archive /// List the content of the .borg archive
List(List), List(List),
/// Check if a checkout can be performed without losing data
#[clap(name = "pre-co")]
PreCo,
} }
#[derive(Debug, Args)] #[derive(Debug, Args)]
...@@ -54,10 +58,13 @@ fn main() { ...@@ -54,10 +58,13 @@ fn main() {
init::init_repository(); init::init_repository();
} }
Commands::Commit(commit) => { Commands::Commit(commit) => {
commit::commit(commit.compression); commit::commit(commit.compression, String::from(""));
} }
Commands::List(list) => { Commands::List(list) => {
list::borg_list(list.first, list.last, &list.archive); list::borg_list(list.first, list.last, &list.archive);
} }
Commands::PreCo => {
checkout::prepare_checkout();
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment