rich-click-rs 1.0.2

Rich help formatting for click-rs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use click::{Command, ContextBuilder, OptionBuilder};
use rich_click_rs::{RichHelp, RichHelpConfig};

fn main() {
    let cmd = Command::new("demo")
        .help("A demo CLI")
        .option(
            OptionBuilder::new(&["-v", "--verbose"])
                .help("Enable verbose output")
                .build(),
        )
        .build();

    let ctx = ContextBuilder::new().info_name("demo").build();
    let help = cmd.get_rich_help_with(&ctx, &RichHelpConfig::default());
    println!("{}", help);
}