summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-10 09:31:03 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-10 10:29:27 +0300
commit3defb987dad68fa45dbf8a0044adb97104d04a0b (patch)
tree8d335215faf7b556961cd908d7d9b177e878938b /src/bin
parent2aa0eef599db13db6802a75a8b285d75d8035033 (diff)
downloadobnam2-3defb987dad68fa45dbf8a0044adb97104d04a0b.tar.gz
refactor: struct Restore subcommand
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/obnam.rs13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/bin/obnam.rs b/src/bin/obnam.rs
index 0552e3b..dcd09f6 100644
--- a/src/bin/obnam.rs
+++ b/src/bin/obnam.rs
@@ -6,8 +6,9 @@ use obnam::cmd::backup::Backup;
use obnam::cmd::init::Init;
use obnam::cmd::list::List;
use obnam::cmd::list_files::ListFiles;
+use obnam::cmd::restore::Restore;
use obnam::cmd::show_gen::ShowGeneration;
-use obnam::cmd::{get_chunk, restore, show_config};
+use obnam::cmd::{get_chunk, show_config};
use obnam::config::ClientConfig;
use std::path::{Path, PathBuf};
use structopt::StructOpt;
@@ -36,7 +37,7 @@ fn main() -> anyhow::Result<()> {
Command::List(x) => x.run(&config),
Command::ShowGeneration(x) => x.run(&config),
Command::ListFiles(x) => x.run(&config),
- Command::Restore { gen_id, to } => restore(&config, &gen_id, &to),
+ Command::Restore(x) => x.run(&config),
Command::GetChunk { chunk_id } => get_chunk(&config, &chunk_id),
Command::Config => show_config(&config),
}
@@ -103,13 +104,7 @@ enum Command {
Backup(Backup),
List(List),
ListFiles(ListFiles),
- Restore {
- #[structopt()]
- gen_id: String,
-
- #[structopt(parse(from_os_str))]
- to: PathBuf,
- },
+ Restore(Restore),
ShowGeneration(ShowGeneration),
GetChunk {
#[structopt()]