aboutsummaryrefslogtreecommitdiff
path: root/examples/after_help.rs
blob: 75816c7425bfc1b41b72f28057f3f9f0b5af0d57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! How to append a postscript to the help message generated.
//!
//! Running this example with --help prints this message:
//! -----------------------------------------------------
//! structopt 0.3.25
//! I am a program and I do things.
//!
//! Sometimes they even work.
//!
//! USAGE:
//!     after_help [FLAGS]
//!
//! FLAGS:
//!     -d
//!             Release the dragon
//!
//!     -h, --help
//!             Prints help information
//!
//!     -V, --version
//!             Prints version information
//!
//!
//! Beware `-d`, dragons be here
//! -----------------------------------------------------

use structopt::StructOpt;

/// I am a program and I do things.
///
/// Sometimes they even work.
#[derive(StructOpt, Debug)]
#[structopt(after_help = "Beware `-d`, dragons be here")]
struct Opt {
    /// Release the dragon.
    #[structopt(short)]
    dragon: bool,
}

fn main() {
    let opt = Opt::from_args();
    println!("{:?}", opt);
}