derive
: Is there a way to opt out of help
subcommands in clap
4?
#5450
-
I'm using a fairly basic setup with the #[derive(Debug, Parser)]
#[clap(name = "cli")]
pub enum Cli {
#[clap(subcommand)]
Sub(Sub)
}
#[derive(Debug, Subcommand)]
pub enum Sub {
One,
Two,
} Playground link here for the example above as well as completions via This results in all the following help-related commands and flags to be generated:
While I appreciate the accessibility, the number of variations results in a lot of noise. For example, in That is:
Is there any way to opt out of one or more of these variations? Ideally I'd like just the top-level |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can set the disable_help_subcommand raw attribute. I'm a bit surprised it lists all depths of subcommands when just completing the command. Is that a general behavior in nushell (e.g. does |
Beta Was this translation helpful? Give feedback.
You can set the disable_help_subcommand raw attribute.
I'm a bit surprised it lists all depths of subcommands when just completing the command. Is that a general behavior in nushell (e.g. does
git\t
includegit stash pop
?) or is that a bug in our completer?