diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-12-23 09:44:31 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-12-23 10:17:17 +0200 |
commit | 15ce048ca21ad517e27ab598d861ae07f817067d (patch) | |
tree | 01857ffa023c770164a9cc07d1024ed388150864 /src/cmd/backup.rs | |
parent | d6584921d8bb77fd4de8b6997848599cb9d73e01 (diff) | |
download | obnam2-15ce048ca21ad517e27ab598d861ae07f817067d.tar.gz |
feat! add a global --config option
This breaks all invocations of the Obnam client, as the option needs
to come before the subcommand name.
The benefit of this breakage is simpler, less repetitive code.
Diffstat (limited to 'src/cmd/backup.rs')
-rw-r--r-- | src/cmd/backup.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cmd/backup.rs b/src/cmd/backup.rs index 86f1b96..178684f 100644 --- a/src/cmd/backup.rs +++ b/src/cmd/backup.rs @@ -3,13 +3,11 @@ use crate::fsiter::FsIterator; use crate::generation::Generation; use indicatif::{ProgressBar, ProgressStyle}; use log::info; -use std::path::Path; use tempfile::NamedTempFile; const GUESS_FILE_COUNT: u64 = 0; -pub fn backup(config: &Path, buffer_size: usize) -> anyhow::Result<()> { - let config = ClientConfig::read_config(config)?; +pub fn backup(config: &ClientConfig, buffer_size: usize) -> anyhow::Result<()> { let client = BackupClient::new(&config.server_url)?; // Create a named temporary file. We don't meed the open file |