summaryrefslogtreecommitdiff
path: root/src/bin
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-10 09:22:45 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-10 10:29:27 +0300
commit7a32584448ebe00bdb45aa5daf506ce37c4811e0 (patch)
tree33249e98feb9f38b66d8961df007589798d875e4 /src/bin
parentc196a68471dd9dafbcc4030342aa4164d7a2d3e3 (diff)
downloadobnam2-7a32584448ebe00bdb45aa5daf506ce37c4811e0.tar.gz
refactor: struct ShowGeneration subcommand
Diffstat (limited to 'src/bin')
-rw-r--r--src/bin/obnam.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bin/obnam.rs b/src/bin/obnam.rs
index 9e0ab0f..72dc208 100644
--- a/src/bin/obnam.rs
+++ b/src/bin/obnam.rs
@@ -5,7 +5,8 @@ use log4rs::config::{Appender, Config, Logger, Root};
use obnam::cmd::backup::Backup;
use obnam::cmd::init::Init;
use obnam::cmd::list::List;
-use obnam::cmd::{get_chunk, list_files, restore, show_config, show_generation};
+use obnam::cmd::show_gen::ShowGeneration;
+use obnam::cmd::{get_chunk, list_files, restore, show_config};
use obnam::config::ClientConfig;
use std::path::{Path, PathBuf};
use structopt::StructOpt;
@@ -32,7 +33,7 @@ fn main() -> anyhow::Result<()> {
Command::Init(_) => panic!("this cannot happen"),
Command::Backup(x) => x.run(&config),
Command::List(x) => x.run(&config),
- Command::ShowGeneration { gen_id } => show_generation(&config, &gen_id),
+ Command::ShowGeneration(x) => x.run(&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),
@@ -111,10 +112,7 @@ enum Command {
#[structopt(parse(from_os_str))]
to: PathBuf,
},
- ShowGeneration {
- #[structopt(default_value = "latest")]
- gen_id: String,
- },
+ ShowGeneration(ShowGeneration),
GetChunk {
#[structopt()]
chunk_id: String,