customize_help/
customize_help.rs

1//! `--help` output customizations
2//!
3//! help header, help footer, a short description and a custom usage line
4use bpaf::*;
5
6fn main() {
7    let opt = short('d')
8        .help("Release the dragon")
9        .switch()
10        .to_options()
11        .descr("I am a program and I do things")
12        .header("Sometimes they even work.")
13        .footer("Beware `-d`, dragons be here")
14        .with_usage(|doc| {
15            let mut u = Doc::default();
16            u.emphasis("You can call it with following flags:");
17            u.text(" ");
18            u.doc(&doc);
19            u
20        })
21        .run();
22
23    println!("{:?}", opt);
24}