1

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.

Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44

1 Answers1

1

Figured it out, turns out you need to do this:

#[clap(subcommand, hide(true))]

This also works:

#[clap(subcommand, hide = true)]
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44