From fb7d2357de2dcb19f048ef3b3e68b7930ce691f9 Mon Sep 17 00:00:00 2001 From: Mario Wenzel Date: Wed, 20 Jun 2018 22:26:36 +0200 Subject: [PATCH] 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. --- tools/cli/src/mentat_cli/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/cli/src/mentat_cli/lib.rs b/tools/cli/src/mentat_cli/lib.rs index 9bc4b937..692257c3 100644 --- a/tools/cli/src/mentat_cli/lib.rs +++ b/tools/cli/src/mentat_cli/lib.rs @@ -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. - let key = matches.opt_str("key"); - if key.is_some() && !cfg!(feature = "sqlcipher") { - eprintln!("Decryption key provided, but this build does not have sqlcipher support"); - return 1; - } + let key = match cfg!(feature = "sqlcipher") { + true => matches.opt_str("key"), + false => None, + }; let mut last_arg: Option<&str> = None;