Skip to content

Commit

Permalink
fix: zenohd --cfg (#1263)
Browse files Browse the repository at this point in the history
* fix: zenohd --cfg

* ci: trigger

* Update zenohd/src/main.rs

---------

Co-authored-by: Luca Cominardi <[email protected]>
  • Loading branch information
YuanYuYuan and Mallets authored Jul 25, 2024
1 parent b3e42ce commit 0a969cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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.
* `--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.
* `--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.
* `-l, --listen <ENDPOINT>...`: 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/<host_name_or_IPv4_or_IPv6>:<port>`
Expand Down
2 changes: 2 additions & 0 deletions zenohd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0a969cb

Please sign in to comment.