Skip to content

Commit e113efb

Browse files
committed
feat: use bright colors
1 parent 3397941 commit e113efb

File tree

7 files changed

+46
-46
lines changed

7 files changed

+46
-46
lines changed

src/commands/help.rs

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use crate::{
1010
};
1111

1212
fn format_subcommand(command: &str, description: &str) -> String {
13-
let command = command.yellow();
13+
let command = command.bright_yellow();
1414
format!("{command}\n {}", format_description(description))
1515
}
1616

1717
pub fn format_description(description: &str) -> String {
18-
format!("{} {description}", "»".black())
18+
format!("{} {description}", "»".bright_black())
1919
}
2020

2121
pub static HELP_FLAG: Flag<'static> = Flag {
@@ -38,13 +38,13 @@ pub static VERSION_FLAG: Flag<'static> = Flag {
3838

3939
pub fn help(command: Option<&str>) -> anyhow::Result<()> {
4040
let author = "Nikita Revenco ".italic();
41-
let less_than = "<".black().italic();
41+
let less_than = "<".bright_black().italic();
4242
let email = "[email protected]".italic();
43-
let greater_than = ">".black().italic();
44-
let app_name = APP_NAME.blue();
45-
let flags_label = "[<flags>]".magenta();
46-
let command_str = "<command>".yellow();
47-
let args = "[<args>]".green();
43+
let greater_than = ">".bright_black().italic();
44+
let app_name = APP_NAME.bright_blue();
45+
let flags_label = "[<flags>]".bright_magenta();
46+
let command_str = "<command>".bright_yellow();
47+
let args = "[<args>]".bright_green();
4848
let version = env!("CARGO_PKG_VERSION");
4949
let init = format_subcommand("init", "Create example config file");
5050
let pr_fetch = format_subcommand(
@@ -62,7 +62,7 @@ pub fn help(command: Option<&str>) -> anyhow::Result<()> {
6262

6363
match command {
6464
Some(cmd_name @ "init") => {
65-
let this_command_name = format!("{app_name} {}", cmd_name.yellow());
65+
let this_command_name = format!("{app_name} {}", cmd_name.bright_yellow());
6666

6767
let description = format_description("Create example config file");
6868

@@ -82,7 +82,7 @@ pub fn help(command: Option<&str>) -> anyhow::Result<()> {
8282
);
8383
}
8484
Some(cmd_name @ "run") => {
85-
let this_command_name = format!("{app_name} {}", cmd_name.yellow());
85+
let this_command_name = format!("{app_name} {}", cmd_name.bright_yellow());
8686

8787
let description = format_description("Create example config file");
8888

@@ -102,7 +102,7 @@ pub fn help(command: Option<&str>) -> anyhow::Result<()> {
102102
);
103103
}
104104
Some(cmd_name @ "gen-patch") => {
105-
let this_command_name = format!("{app_name} {}", cmd_name.yellow());
105+
let this_command_name = format!("{app_name} {}", cmd_name.bright_yellow());
106106

107107
let patch_filename_flag = format_flag(&GEN_PATCH_NAME_FLAG);
108108

@@ -111,25 +111,25 @@ pub fn help(command: Option<&str>) -> anyhow::Result<()> {
111111
let example_1 = format!(
112112
"{}
113113
{}",
114-
"133cbaae83f710b793c98018cea697a04479bbe4".green(),
114+
"133cbaae83f710b793c98018cea697a04479bbe4".bright_green(),
115115
format_description("Generate a single .patch file from one commit hash")
116116
);
117117

118118
let example_2 = format!(
119119
"{}
120120
{}",
121-
"133cbaae83f710b793c98018cea697a04479bbe4 9ad5aa637ccf363b5d6713f66d0c2830736c35a9 cc75a895f344cf2fe83eaf6d78dfb7aeac8b33a4".green(),
121+
"133cbaae83f710b793c98018cea697a04479bbe4 9ad5aa637ccf363b5d6713f66d0c2830736c35a9 cc75a895f344cf2fe83eaf6d78dfb7aeac8b33a4".bright_green(),
122122
format_description("Generate several .patch files from several commit hashes")
123123
);
124124

125125
let example_3 = format!(
126126
"{} {} {} {} {}
127127
{}",
128-
"133cbaae83f710b793c98018cea697a04479bbe4".green(),
129-
"--patch-filename=some-patch".magenta(),
130-
"9ad5aa637ccf363b5d6713f66d0c2830736c35a9".green(),
131-
"--patch-filename=another-patch".magenta(),
132-
"cc75a895f344cf2fe83eaf6d78dfb7aeac8b33a4".green(),
128+
"133cbaae83f710b793c98018cea697a04479bbe4".bright_green(),
129+
"--patch-filename=some-patch".bright_magenta(),
130+
"9ad5aa637ccf363b5d6713f66d0c2830736c35a9".bright_green(),
131+
"--patch-filename=another-patch".bright_magenta(),
132+
"cc75a895f344cf2fe83eaf6d78dfb7aeac8b33a4".bright_green(),
133133
format_description(
134134
"Generate several .patch files from several commit hashes and give 2 of them custom names"
135135
)
@@ -166,25 +166,25 @@ pub fn help(command: Option<&str>) -> anyhow::Result<()> {
166166
let example_1 = format!(
167167
"{}
168168
{}",
169-
"11745".green(),
169+
"11745".bright_green(),
170170
format_description("Fetch a single pull request")
171171
);
172172

173173
let example_2 = format!(
174174
"{}
175175
{}",
176-
"11745 10000 9191 600".green(),
176+
"11745 10000 9191 600".bright_green(),
177177
format_description("Fetch several pull requests")
178178
);
179179

180180
let example_3 = format!(
181181
"{} {} {} {} {}
182182
{}",
183-
"11745 10000".green(),
184-
"--branch-name=some-pr".magenta(),
185-
"9191".green(),
186-
"--branch-name=another-pr".magenta(),
187-
"600".green(),
183+
"11745 10000".bright_green(),
184+
"--branch-name=some-pr".bright_magenta(),
185+
"9191".bright_green(),
186+
"--branch-name=another-pr".bright_magenta(),
187+
"600".bright_green(),
188188
format_description(
189189
"Fetch several pull requests and choose custom branch names for the pull requests #10000 and #9191"
190190
)
@@ -193,23 +193,23 @@ pub fn help(command: Option<&str>) -> anyhow::Result<()> {
193193
let example_4 = format!(
194194
"{} {} {}
195195
{}",
196-
"--repo-name=helix-editor/helix".magenta(),
197-
"11745 10000 9191 600".green(),
198-
"--checkout".magenta(),
196+
"--repo-name=helix-editor/helix".bright_magenta(),
197+
"11745 10000 9191 600".bright_green(),
198+
"--checkout".bright_magenta(),
199199
format_description("Fetch several pull requests, checkout the first one and use a custom github repo: https://github.com/helix-editor/helix")
200200
);
201201

202202
let example_5 = format!(
203203
"{}
204204
{}",
205-
"11745 10000@be8f264327f6ae729a0b372ef01f6fde49a78310 9191 600@5d10fa5beb917a0dbe0ef8441d14b3d0dd15227b".green(),
205+
"11745 10000@be8f264327f6ae729a0b372ef01f6fde49a78310 9191 600@5d10fa5beb917a0dbe0ef8441d14b3d0dd15227b".bright_green(),
206206
format_description("Fetch several pull requests at a certain commit")
207207
);
208208

209209
let branch_name_flag = format_flag(&PR_FETCH_BRANCH_NAME_FLAG);
210210
let checkout_flag = format_flag(&PR_FETCH_CHECKOUT_FLAG);
211211
let repo_name_flag = format_flag(&PR_FETCH_REPO_NAME_FLAG);
212-
let this_command_name = format!("{app_name} {}", cmd_name.yellow());
212+
let this_command_name = format!("{app_name} {}", cmd_name.bright_yellow());
213213

214214
println!(
215215
"

src/commands/init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn init(_args: &CommandArgs) -> anyhow::Result<()> {
2121
if config_file_path.exists()
2222
&& !confirm_prompt!(
2323
"File {} already exists. Overwrite it?",
24-
config_file_path.to_string_lossy().blue(),
24+
config_file_path.to_string_lossy().bright_blue(),
2525
)
2626
{
2727
anyhow::bail!("Did not overwrite {config_file_path:?}");

src/commands/pr_fetch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,11 @@ pub async fn pr_fetch(args: &CommandArgs) -> anyhow::Result<()> {
145145
"{}{} {}",
146146
"#".bright_blue(),
147147
pull_request.bright_blue(),
148-
response.title.blue().italic()
148+
response.title.bright_blue().italic()
149149
),
150150
&response.html_url
151151
),
152-
info.branch.local_branch_name.cyan(),
152+
info.branch.local_branch_name.bright_cyan(),
153153
hash.clone()
154154
.map(|commit_hash| format!(", at commit {}", commit_hash.bright_yellow()))
155155
.unwrap_or_default()

src/commands/run.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ pub async fn run(args: &CommandArgs) -> anyhow::Result<()> {
5050

5151
if confirm_prompt!(
5252
"Would you like us to run {} {} to initialize it?",
53-
"patchy".blue(),
54-
"init".yellow(),
53+
"patchy".bright_blue(),
54+
"init".bright_yellow(),
5555
) {
5656
init(args)?;
5757
}
@@ -134,7 +134,7 @@ pub async fn run(args: &CommandArgs) -> anyhow::Result<()> {
134134
"{}{} {}",
135135
"#".bright_blue(),
136136
pull_request.bright_blue(),
137-
&response.title.blue().italic()
137+
&response.title.bright_blue().italic()
138138
),
139139
&response.html_url
140140
),
@@ -194,7 +194,7 @@ pub async fn run(args: &CommandArgs) -> anyhow::Result<()> {
194194
.lines()
195195
.next()
196196
.unwrap_or_default()
197-
.blue()
197+
.bright_blue()
198198
.italic()
199199
);
200200
}
@@ -230,13 +230,13 @@ pub async fn run(args: &CommandArgs) -> anyhow::Result<()> {
230230
&temporary_branch,
231231
&config.local_branch,
232232
])?;
233-
println!("\n{INDENT}{}", " Success!\n".green().bold());
233+
println!("\n{INDENT}{}", " Success!\n".bright_green().bold());
234234
} else {
235235
let command = format!(
236236
" git branch --move --force {temporary_branch} {}",
237237
config.local_branch
238238
);
239-
let command = format!("\n{INDENT}{}\n", command.magenta(),);
239+
let command = format!("\n{INDENT}{}\n", command.bright_magenta(),);
240240
println!(
241241
"\n{INDENT} You can still manually overwrite {} with the following command:\n {command}",
242242
config.local_branch.cyan(),

src/flags.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ pub fn is_valid_flag(arg: &str, available_flags: &[&Flag]) -> bool {
5959
pub fn format_flag(flag: &Flag) -> String {
6060
format!(
6161
"{}{}{}\n {}",
62-
flag.short.magenta(),
63-
", ".black(),
64-
flag.long.magenta(),
62+
flag.short.bright_magenta(),
63+
", ".bright_black(),
64+
flag.long.bright_magenta(),
6565
format_description(flag.description)
6666
)
6767
}

src/main.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ async fn process_subcommand(subcommand: &str, args: CommandArgs) -> Result<()> {
2626
" Unknown {unknown}: {}",
2727
unrecognized,
2828
unknown = if unrecognized.starts_with("-") {
29-
"flag".red()
29+
"flag".bright_red()
3030
} else {
31-
"command".red()
31+
"command".bright_red()
3232
}
3333
)
34-
.red()
34+
.bright_red()
3535
)
3636
}
3737

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ macro_rules! confirm_prompt {
100100
Confirm::new()
101101
.with_prompt(format!(
102102
"\n{INDENT}{} {}",
103-
"»".black(),
103+
"»".bright_black(),
104104
format!($($arg)*)
105105
))
106106
.interact()

0 commit comments

Comments
 (0)