From 0a969cb8bbb670a02b16c0373b133b00d58f1aaf Mon Sep 17 00:00:00 2001 From: Yuyuan Yuan Date: Thu, 25 Jul 2024 23:09:03 +0800 Subject: [PATCH] fix: zenohd --cfg (#1263) * fix: zenohd --cfg * ci: trigger * Update zenohd/src/main.rs --------- Co-authored-by: Luca Cominardi --- README.md | 2 +- zenohd/src/main.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af08db7260..6ecdf65d88 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ See other examples of Zenoh usage in [examples/](examples) * `--adminspace-permissions <[r|w|rw|none]>`: Configure the read and/or write permissions on the admin space. Default is read only. * `-c, --config `: a [JSON5](https://json5.org) configuration file. [DEFAULT_CONFIG.json5](DEFAULT_CONFIG.json5) shows the schema of this file. All properties of this configuration are optional, so you may not need such a large configuration for your use-case. - * `--cfg :`: allows you to change specific parts of the configuration right after it has been constructed. VALUE must be a valid JSON5 value, and key must be a path through the configuration file, where each element is separated by a `/`. When inserting in parts of the config that are arrays, you may use indexes, or may use `+` to indicate that you want to append your value to the array. `--cfg` passed values will always override any previously existing value for their key in the configuration. + * `--cfg [:]...`: allows you to change specific parts of the configuration right after it has been constructed. VALUE must be a valid JSON5 value, and key must be a path through the configuration file, where each element is separated by a `/`. When inserting in parts of the config that are arrays, you may use indexes, or may use `+` to indicate that you want to append your value to the array. `--cfg` passed values will always override any previously existing value for their key in the configuration. * `-l, --listen ...`: An endpoint on which this router will listen for incoming sessions. Repeat this option to open several listeners. By default, `tcp/[::]:7447` is used. The following endpoints are currently supported: - TCP: `tcp/:` diff --git a/zenohd/src/main.rs b/zenohd/src/main.rs index 850676d905..18ac0c4e07 100644 --- a/zenohd/src/main.rs +++ b/zenohd/src/main.rs @@ -271,6 +271,8 @@ fn config_from_args(args: &Args) -> Config { } Err(e) => tracing::warn!("Couldn't perform configuration {}: {}", json, e), } + } else { + panic!("--cfg accepts KEY:VALUE pairs. {} is not a valid KEY:VALUE pair.", json) } } tracing::debug!("Config: {:?}", &config);