Skip to content

Commit

Permalink
chore: enable rest plugin only if in config or if --rest-http-port is…
Browse files Browse the repository at this point in the history
… passed

Signed-off-by: Gabriele Baldoni <[email protected]>
  • Loading branch information
gabrik committed Nov 13, 2024
1 parent 99d062e commit 116028b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions zenohd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,8 @@ fn config_from_args(args: &Args) -> Config {
if let Some(id) = &args.id {
config.set_id(id.parse().unwrap()).unwrap();
}
// apply '--rest-http-port' to config only if explicitly set (overwriting config),
// or if no config file is set (to apply its default value)
if args.rest_http_port.is_some() || args.config.is_none() {
// apply '--rest-http-port' to config only if explicitly set (overwriting config)
if args.rest_http_port.is_some() {
let value = args.rest_http_port.as_deref().unwrap_or("8000");
if !value.eq_ignore_ascii_case("none") {
config
Expand Down

0 comments on commit 116028b

Please sign in to comment.