diff --git a/docs/CommandLineHelp.md b/docs/CommandLineHelp.md index 40ba19b..299b777 100644 --- a/docs/CommandLineHelp.md +++ b/docs/CommandLineHelp.md @@ -481,7 +481,7 @@ Runs Edge App emulator ###### **Options:** * `-p`, `--path ` — Path to the directory with the manifest. If not specified CLI will use the current working directory -* `-s`, `--secrets ` +* `-s`, `--secrets ` — Secrets to be passed to the Edge App in the form KEY=VALUE. Can be specified multiple times * `-g`, `--generate-mock-data` — Generates mock data to be used with Edge App run diff --git a/src/cli.rs b/src/cli.rs index 8f0cf7d..93236cb 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -320,6 +320,7 @@ pub enum EdgeAppCommands { #[arg(short, long)] path: Option, + /// Secrets to be passed to the Edge App in the form KEY=VALUE. Can be specified multiple times. #[arg(short, long, value_parser = parse_key_values::)] secrets: Option, diff --git a/src/commands/edge_app/setting.rs b/src/commands/edge_app/setting.rs index 72131f8..92976a5 100644 --- a/src/commands/edge_app/setting.rs +++ b/src/commands/edge_app/setting.rs @@ -20,10 +20,7 @@ impl EdgeAppCommand { setting_key: &str, setting_value: &str, ) -> Result<(), CommandError> { - let installation_id = match self.get_installation_id(path.clone()) { - Ok(id) => Some(id), - Err(_) => None, - }; + let installation_id = self.get_installation_id(path.clone()).ok(); let actual_installation_id = match installation_id { Some(id) => id.clone(), None => "".to_string(), diff --git a/src/commands/edge_app/utils.rs b/src/commands/edge_app/utils.rs index f9850f5..8a3e707 100644 --- a/src/commands/edge_app/utils.rs +++ b/src/commands/edge_app/utils.rs @@ -1066,7 +1066,7 @@ mod tests { } #[test] - fn test_transform_edge_app_path_to_manifest_when_path_provided_should_return_path_with_instance_manifest( + fn test_transform_edge_app_path_to_manifest_when_path_provided_should_return_path_with_manifest( ) { let dir = tempdir().unwrap(); let dir_path = dir.path(); diff --git a/src/commands/serde_utils.rs b/src/commands/serde_utils.rs index fbf9bca..b4b7db9 100644 --- a/src/commands/serde_utils.rs +++ b/src/commands/serde_utils.rs @@ -65,5 +65,8 @@ where } pub fn string_field_is_none_or_empty(opt: &Option) -> bool { - opt.as_ref().map_or(true, |s| s.is_empty()) + match opt.as_ref() { + None => true, + Some(s) => s.is_empty(), + } }