clap 4 seems to index these by bare type name (!)
and panics if they aren't unique (!!)
running 1 test
test verify_cli ... FAILED
failures:
---- verify_cli stdout ----
thread 'verify_cli' panicked at 'Command hippotat: Argument group name must be unique
'Opts' is already in use', /home/rustcargo/.cargo/registry/src/index.crates.io-
6f17d22bba15001f/clap_builder-4.3.4/src/builder/debug_asserts.rs:278:9
stack backtrace:
0: rust_begin_unwind
at /rustc/
071f14baae931e17a5a99366bf216e76384cc4f6/library/std/src/panicking.rs:578:5
1: core::panicking::panic_fmt
at /rustc/
071f14baae931e17a5a99366bf216e76384cc4f6/library/core/src/panicking.rs:67:14
2: clap_builder::builder::debug_asserts::assert_app
at /home/rustcargo/.cargo/registry/src/index.crates.io-
6f17d22bba15001f/clap_builder-4.3.4/src/builder/debug_asserts.rs:278:9
3: clap_builder::builder::command::Command::_build_self
at /home/rustcargo/.cargo/registry/src/index.crates.io-
6f17d22bba15001f/clap_builder-4.3.4/src/builder/command.rs:3945:13
4: clap_builder::builder::command::Command::_build_recursive
at /home/rustcargo/.cargo/registry/src/index.crates.io-
6f17d22bba15001f/clap_builder-4.3.4/src/builder/command.rs:3843:9
5: clap_builder::builder::command::Command::build
at /home/rustcargo/.cargo/registry/src/index.crates.io-
6f17d22bba15001f/clap_builder-4.3.4/src/builder/command.rs:3838:9
6: clap_builder::builder::command::Command::debug_assert
at /home/rustcargo/.cargo/registry/src/index.crates.io-
6f17d22bba15001f/clap_builder-4.3.4/src/builder/command.rs:489:9
7: hippotat::utils::verify_cli
at ./src/utils.rs:236:3
8: hippotat::verify_cli
at ./client/client.rs:383:3
9: hippotat::verify_cli::{{closure}}
at ./client/client.rs:382:17
10: core::ops::function::FnOnce::call_once
at /rustc/
071f14baae931e17a5a99366bf216e76384cc4f6/library/core/src/ops/function.rs:250:5
11: core::ops::function::FnOnce::call_once
at /rustc/
071f14baae931e17a5a99366bf216e76384cc4f6/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failures:
verify_cli
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
log: LogOpts,
#[clap(flatten)]
- config: config::Opts,
+ config: config::CommonOpts,
/// Print config item(s), do not actually run
///
pub log: LogOpts,
#[clap(flatten)]
- pub config: config::Opts,
+ pub config: config::CommonOpts,
/// Daemonise
#[clap(long)]
"#;
#[derive(clap::Args,Debug)]
-pub struct Opts {
+pub struct CommonOpts {
/// Top-level config file or directory
///
/// Look for `main.cfg`, `config.d` and `secrets.d` here.
}
pub struct Config {
- pub opts: Opts,
+ pub opts: CommonOpts,
}
static OUTSIDE_SECTION: &str = "[";
}
#[throws(AE)]
-pub fn read(opts: &Opts, end: LinkEnd)
+pub fn read(opts: &CommonOpts, end: LinkEnd)
-> (Option<ServerName>, Vec<InstanceConfig>)
{
let agg = (||{
}
pub fn startup<F,T,G,U>(progname: &str, end: LinkEnd,
- opts: &Opts, logopts: &LogOpts,
+ opts: &CommonOpts, logopts: &LogOpts,
f: F, g: G) -> U
where F: FnOnce(Option<ServerName>, &[InstanceConfig]) -> Result<T,AE>,
G: FnOnce(T, Vec<InstanceConfig>) -> Result<U,AE>,