summaryrefslogtreecommitdiff
path: root/src/cmd/init.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-05-29 11:39:31 +0300
committerLars Wirzenius <liw@liw.fi>2021-05-29 15:11:53 +0300
commit08b71890de3407acc323f09330ebe8a8ee2782ec (patch)
tree859d2a26dcc5517105bf5078f273fd24672ad756 /src/cmd/init.rs
parente839c5f1c93e1fe024a2656d319721a7b23c6461 (diff)
downloadobnam2-08b71890de3407acc323f09330ebe8a8ee2782ec.tar.gz
refactor: only have client config without passwords
This means the config is always the config, and not sometimes the config or the config and passwords. Also, there's no config option for encrypting, anymore. It will not be optional now.
Diffstat (limited to 'src/cmd/init.rs')
-rw-r--r--src/cmd/init.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/cmd/init.rs b/src/cmd/init.rs
index cb61fba..08060f7 100644
--- a/src/cmd/init.rs
+++ b/src/cmd/init.rs
@@ -1,4 +1,4 @@
-use crate::config::ClientConfigWithoutPasswords;
+use crate::config::ClientConfig;
use crate::error::ObnamError;
use crate::passwords::{passwords_filename, Passwords};
use structopt::StructOpt;
@@ -12,11 +12,7 @@ pub struct Init {
}
impl Init {
- pub fn run(&self, config: &ClientConfigWithoutPasswords) -> Result<(), ObnamError> {
- if !config.encrypt {
- panic!("no encryption specified");
- }
-
+ pub fn run(&self, config: &ClientConfig) -> Result<(), ObnamError> {
let passphrase = match &self.insecure_passphrase {
Some(x) => x.to_string(),
None => rpassword::read_password_from_tty(Some(PROMPT)).unwrap(),