Don't try to match "key" when not using sqlcipher. (#752, #753) r=nalexander

This causes a runtime error, since `opt_str("key")` isn't recognized.
This commit is contained in:
Mario Wenzel 2018-06-20 22:26:36 +02:00 committed by Nick Alexander
parent aae50f40ac
commit fb7d2357de

View file

@ -78,11 +78,10 @@ pub fn run() -> i32 {
} }
// It's still possible to pass this in even if it's not a documented flag above. // It's still possible to pass this in even if it's not a documented flag above.
let key = matches.opt_str("key"); let key = match cfg!(feature = "sqlcipher") {
if key.is_some() && !cfg!(feature = "sqlcipher") { true => matches.opt_str("key"),
eprintln!("Decryption key provided, but this build does not have sqlcipher support"); false => None,
return 1; };
}
let mut last_arg: Option<&str> = None; let mut last_arg: Option<&str> = None;