I have code like this:
#[derive(Subcommand)]
pub enum MyTool {
Clean(CleanPackage),
Compile(CompilePackage),
#[clap(subcommand)]
Coverage(coverage::CoveragePackage),
#[clap(subcommand)]
Show(show::ShowTool),
Test(TestPackage),
View(ViewFunction),
}
I want the subcommand group under show to be hidden from help text. I have tried the following:
#[clap(subcommand, hidden)]
#[clap(subcommand, hide)]
But neither of these work. Is what I want to do possible with clap, specifically with the "structopt style" of representing the argument parser?
I'm using clap version 3.2.23.
Figured it out, turns out you need to do this:
#[clap(subcommand, hide(true))]
This also works:
#[clap(subcommand, hide = true)]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With