Skip to content

Commit 0a969cb

Browse files
YuanYuYuanMallets
andauthored
fix: zenohd --cfg (#1263)
* fix: zenohd --cfg * ci: trigger * Update zenohd/src/main.rs --------- Co-authored-by: Luca Cominardi <[email protected]>
1 parent b3e42ce commit 0a969cb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ See other examples of Zenoh usage in [examples/](examples)
145145

146146
* `--adminspace-permissions <[r|w|rw|none]>`: Configure the read and/or write permissions on the admin space. Default is read only.
147147
* `-c, --config <FILE>`: 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.
148-
* `--cfg <KEY>:<VALUE>`: 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.
148+
* `--cfg [<KEY>:<VALUE>]...`: 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.
149149
* `-l, --listen <ENDPOINT>...`: An endpoint on which this router will listen for incoming sessions.
150150
Repeat this option to open several listeners. By default, `tcp/[::]:7447` is used. The following endpoints are currently supported:
151151
- TCP: `tcp/<host_name_or_IPv4_or_IPv6>:<port>`

zenohd/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ fn config_from_args(args: &Args) -> Config {
271271
}
272272
Err(e) => tracing::warn!("Couldn't perform configuration {}: {}", json, e),
273273
}
274+
} else {
275+
panic!("--cfg accepts KEY:VALUE pairs. {} is not a valid KEY:VALUE pair.", json)
274276
}
275277
}
276278
tracing::debug!("Config: {:?}", &config);

0 commit comments

Comments
 (0)