Skip to content

Commit

Permalink
simplify no_bold logic
Browse files Browse the repository at this point in the history
  • Loading branch information
o2sh committed Oct 12, 2020
1 parent 8419edd commit be96551
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/onefetch/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ impl Options {
Vec::new()
},
disabled_fields: info_fields::get_disabled_fields(fields_to_hide)?,
no_bold: !matches.is_present("no-bold"),
no_bold: matches.is_present("no-bold"),
image,
image_backend,
no_merges: matches.is_present("no-merge-commits"),
Expand Down
9 changes: 5 additions & 4 deletions src/onefetch/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl std::fmt::Display for Info {
}
} else {
let mut logo_lines =
AsciiArt::new(self.get_ascii(), self.colors(), self.config.no_bold);
AsciiArt::new(self.get_ascii(), self.colors(), !self.config.no_bold);
loop {
match (logo_lines.next(), info_lines.next()) {
(Some(logo_line), Some(info_line)) => {
Expand Down Expand Up @@ -780,11 +780,12 @@ impl Info {

/// Returns a formatted info label with the desired color and boldness
fn get_formatted_info_label(&self, label: &str, color: Color) -> ColoredString {
let mut formatted_label = label.color(color);
let formatted_label = label.color(color);
if self.config.no_bold {
formatted_label = formatted_label.bold();
formatted_label
} else {
formatted_label.bold()
}
formatted_label
}
}

Expand Down

0 comments on commit be96551

Please sign in to comment.