I have this:
use clap::Parser;
use twelf::config;
#[config]
#[derive(Parser)]
#[clap]
struct Config {
#[clap(
long,
short = 's',
help = "The server to connect to",
display_order = 0
)]
host: Option<String>,
#[clap(
long,
short,
help = "The port to use",
display_order = 1
)]
port: Option<u16>,
}
I expect a help like this:
USAGE:
foo [OPTIONS]
OPTIONS:
-s, --host <HOST> The server to connect to
-p, --port <PORT> The port to use
-h, --help Print help information
But I get this:
USAGE:
foo [OPTIONS]
OPTIONS:
-h, --help Print help information
--host <host>
--port <port>
I.e. it seems all clap-derive macro-related info is somehow ignored/lost.
I presume one key issue is that #[config] also creates a parse() method that somehow clashes with the one the #[derive(Parser)] wants to generate.
I have this:
I expect a help like this:
But I get this:
I.e. it seems all
clap-derivemacro-related info is somehow ignored/lost.I presume one key issue is that
#[config]also creates aparse()method that somehow clashes with the one the#[derive(Parser)]wants to generate.