summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-01-04 18:57:49 +0200
committerLars Wirzenius <liw@liw.fi>2021-01-04 20:02:06 +0200
commit8efabc60f87e5462b01f4832d575f68382929624 (patch)
tree422b3941b6867871486df2198aef0e431c6b95ac /src/bin
parent650b7cee5700eae9ab6c300fbdb816dead6f01f5 (diff)
downloadobnam2-8efabc60f87e5462b01f4832d575f68382929624.tar.gz
feat: verify checksum of chunks downloaded from server
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/obnam.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/obnam.rs b/src/bin/obnam.rs
index f31884b..e5703ed 100644
--- a/src/bin/obnam.rs
+++ b/src/bin/obnam.rs
@@ -2,7 +2,7 @@ use log::{debug, error, info, LevelFilter};
use log4rs::append::file::FileAppender;
use log4rs::config::{Appender, Config, Logger, Root};
use obnam::client::ClientConfig;
-use obnam::cmd::{backup, list, list_files, restore};
+use obnam::cmd::{backup, get_chunk, list, list_files, restore};
use std::path::{Path, PathBuf};
use structopt::StructOpt;
@@ -23,6 +23,7 @@ fn main() -> anyhow::Result<()> {
Command::List => list(&config),
Command::ListFiles { gen_id } => list_files(&config, &gen_id),
Command::Restore { gen_id, to } => restore(&config, &gen_id, &to),
+ Command::GetChunk { chunk_id } => get_chunk(&config, &chunk_id),
};
if let Err(ref e) = result {
@@ -60,6 +61,10 @@ enum Command {
#[structopt(parse(from_os_str))]
to: PathBuf,
},
+ GetChunk {
+ #[structopt()]
+ chunk_id: String,
+ },
}
fn setup_logging(filename: &Path) -> anyhow::Result<()> {