Skip to content

Commit

Permalink
fix: arg! macro escaping
Browse files Browse the repository at this point in the history
clap `arg!` macro needs to quote flag/argument
if it contains hyphen.

Signed-off-by: Jean-Pierre Geslin <[email protected]>
  • Loading branch information
Jarsop committed Dec 26, 2023
1 parent d8c27a6 commit fd70238
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/zenoh-plugin-rest/examples/z_serve_sse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ fn parse_args() -> Config {
.arg(arg!(-l --listen [ENDPOINT]... "Endpoints to listen on."))
.arg(arg!(-c --config [FILE] "A configuration file."))
.arg(
arg!(--no-multicast-scouting "Disable the multicast-based scouting mechanism."
arg!(--"no-multicast-scouting" "Disable the multicast-based scouting mechanism."
),
)
.get_matches();
Expand Down
2 changes: 1 addition & 1 deletion zenoh-ext/examples/z_pub_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn parse_args() -> (Config, String, String, usize, Option<String>) {
)
.arg(arg!(-x --prefix [STRING] "An optional queryable prefix"))
.arg(arg!(-c --config [FILE] "A configuration file."))
.arg(arg!(--no-multicast-scouting "Disable the multicast-based scouting mechanism."))
.arg(arg!(--"no-multicast-scouting" "Disable the multicast-based scouting mechanism."))
.get_matches();

let mut config = if let Some(conf_file) = args.get_one::<&String>("config") {
Expand Down
2 changes: 1 addition & 1 deletion zenoh-ext/examples/z_query_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fn parse_args() -> (Config, String, Option<String>) {
arg!(-q --query [SELECTOR] "The selector to use for queries (by default it's same than 'selector' option)")
)
.arg(arg!(-c --config [FILE] "A configuration file."))
.arg(arg!(--no-multicast-scouting "Disable the multicast-based scouting mechanism."))
.arg(arg!(--"no-multicast-scouting" "Disable the multicast-based scouting mechanism."))
.get_matches();

let mut config = if let Some(conf_file) = args.get_one::<&String>("config") {
Expand Down

0 comments on commit fd70238

Please sign in to comment.