Skip to content

How to specify about text for subcommands? #1619

Answered by CreepySkeleton
lucidBrot asked this question in Q&A
Discussion options

You must be logged in to vote

Doc comments for subcommands must be placed on the corresponding enum variant (the same for structopt).

#[derive(Clap)]
enum SubCommand {
     /// A subcommand for controlling testing    
    Test(Test),
}

#[derive(Clap)]
#[clap(name = "test", version = "1.3", author = "Someone Else")]
struct Test {
    /// Print debug info
    #[clap(short = "d")]
    debug: bool
}

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by pksunkara
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants