Replies: 1 comment
-
|
For some reason, I'm not able to reproduce this. I used the following code ( #!/usr/bin/env nargo
---
[dependencies]
clap = { version = "4", features = ["derive"] }
---
use clap::Parser;
use clap::Subcommand;
#[derive(Parser)]
#[command(
name = "foo",
version,
long_about = None
)]
pub(crate) struct Cli {
#[command(subcommand)]
pub(crate) command: Option<Commands>,
}
#[derive(Subcommand)]
pub(crate) enum Commands {
/// Adds something
#[command(visible_alias = "a")]
Add {},
}
fn main() {
Cli::parse();
}$ ./clap-6277.rs --help
warning: `package.edition` is unspecified, defaulting to `2024`
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.14s
Running `/home/epage/.cargo/build/69/f4b38ad1e1ed1a/target/debug/clap-6277 --help`
Usage: clap-6277.rs [COMMAND]
Commands:
add Adds something [aliases: a]
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When an alias is set it usually it is displayed in the help message:
but when a help message is also set:
the alias is nowhere to be seen:
Is there a way to show the alias alongside the help message?
Beta Was this translation helpful? Give feedback.
All reactions