Skip to content

Commit 6a66463

Browse files
committed
fix(cli): disambiguate clap arg ids
1 parent 6e7d418 commit 6a66463

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/cli-macros/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ pub fn prefixed_args(attr: TokenStream, item: TokenStream) -> TokenStream {
5555

5656
let long_value = format!("{}.{}", prefix, field_name);
5757
let long_lit = LitStr::new(&long_value, proc_macro2::Span::call_site());
58-
let long_attr: Attribute = parse_quote!(#[arg(long = #long_lit)]);
58+
let id_lit = LitStr::new(&long_value, proc_macro2::Span::call_site());
59+
let long_attr: Attribute = parse_quote!(#[arg(long = #long_lit, id = #id_lit)]);
5960
field.attrs.push(long_attr);
6061
}
6162
}

crates/cli/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,14 @@ pub struct MetricsOptions {
367367
pub enabled: bool,
368368

369369
/// The metrics will be served at the given address.
370-
#[arg(requires = "enabled")]
370+
#[arg(requires = "metrics.enabled")]
371371
#[arg(value_name = "ADDRESS")]
372372
#[arg(default_value_t = DEFAULT_METRICS_ADDR)]
373373
#[serde(alias = "metrics_addr")]
374374
pub addr: IpAddr,
375375

376376
/// The metrics will be served at the given port.
377-
#[arg(requires = "enabled")]
377+
#[arg(requires = "metrics.enabled")]
378378
#[arg(value_name = "PORT")]
379379
#[arg(default_value_t = DEFAULT_METRICS_PORT)]
380380
#[serde(alias = "metrics_port")]

0 commit comments

Comments
 (0)