From a98c2e10586a9f2a022b18e4a7c74abac23a10b9 Mon Sep 17 00:00:00 2001 From: Pierre Avital Date: Mon, 6 Dec 2021 09:35:54 +0100 Subject: [PATCH] fix port argument --- .gitignore | 2 +- zenoh-bridge-dds/src/main.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 77e677a6..7e518051 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -target +**/target *~ *.log .vscode diff --git a/zenoh-bridge-dds/src/main.rs b/zenoh-bridge-dds/src/main.rs index a368b087..493e30a5 100644 --- a/zenoh-bridge-dds/src/main.rs +++ b/zenoh-bridge-dds/src/main.rs @@ -89,11 +89,11 @@ fn parse_args() -> (Config, ArgMatches<'static>) { This option disables this feature.'") ) .arg(Arg::with_name("rest-port") - .long("port") + .long("rest-http-port") .required(false) .takes_value(true) .value_name("PORT") - .help("Maps to `--cfg=/plugins/rest/port:PORT`. Disabled by default")) + .help("Maps to `--cfg=/plugins/rest/port:PORT`. Disabled by default.")) .args(&customize_dds_args(dds_args())); let args = app.get_matches(); @@ -117,7 +117,10 @@ fn parse_args() -> (Config, ArgMatches<'static>) { config.scouting.multicast.set_enabled(Some(false)).unwrap(); } config.set_add_timestamp(Some(true)).unwrap(); - if let Some(port) = args.value_of("rest-post") { + if let Some(port) = args + .value_of("rest-port") + .filter(|v| v.parse::().is_ok()) + { config.insert_json("plugins/rest/port", port).unwrap(); }