Skip to content

Commit d0d8eb2

Browse files
committed
feat: colored help message
1 parent 0f5b913 commit d0d8eb2

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

src/bin/code-minimap/cli.rs

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
use std::path::PathBuf;
22

3-
use clap::{ArgAction, Parser, ValueEnum};
3+
use clap::{
4+
builder::{
5+
styling::{AnsiColor, Effects},
6+
Styles,
7+
},
8+
ArgAction,
9+
Parser,
10+
ValueEnum,
11+
};
12+
413
use clap_complete::Shell;
514

615
#[derive(Parser)]
7-
#[command(about, version)]
8-
#[command(next_line_help = true)]
9-
#[command(disable_version_flag = true)]
16+
#[clap(about, version)]
17+
#[clap(next_line_help = true)]
18+
#[clap(disable_version_flag = true)]
19+
#[clap(
20+
styles(Styles::styled()
21+
.header(AnsiColor::Yellow.on_default() | Effects::BOLD)
22+
.usage(AnsiColor::Yellow.on_default() | Effects::BOLD)
23+
.literal(AnsiColor::Green.on_default() | Effects::BOLD)
24+
.placeholder(AnsiColor::Cyan.on_default())
25+
)
26+
)]
1027
pub struct App {
1128
/// File to read.
1229
pub file: Option<PathBuf>,

0 commit comments

Comments
 (0)