Skip to content

Commit 8018126

Browse files
committed
Feat(cli): Add colors to Cli Status
1 parent f945ba3 commit 8018126

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,4 @@ neo4rs = "0.8.0"
105105
bytes = "1.10.1"
106106
rand = "0.9.0"
107107
indoc = "2.0.6"
108+
owo-colors = "4.2.0"

src/setup/states.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use crate::prelude::*;
1515

1616
use indenter::indented;
17+
use owo_colors::OwoColorize;
1718
use std::fmt::Debug;
1819
use std::fmt::{Display, Write};
1920
use std::hash::Hash;
@@ -274,14 +275,18 @@ impl<K, S, C: ResourceSetupStatusCheck> std::fmt::Display for ResourceSetupInfo<
274275
Some(SetupChangeType::Invalid) => "INVALID",
275276
None => "USER MANAGED",
276277
};
277-
writeln!(f, "[ {:^9} ] {}", status_code, self.description)?;
278+
// Colors
279+
let status_bg = status_code.on_truecolor(0x5c, 0xe1, 0xe6);
280+
let status_colored = status_bg.truecolor(0xff, 0xff, 0xff);
281+
let desc_colored = self.description.truecolor(0xff, 0xff, 0xff);
282+
writeln!(f, "[ {:^9} ] {}", status_colored, desc_colored)?;
278283
if let Some(status_check) = &self.status_check {
279284
let changes = status_check.describe_changes();
280285
if !changes.is_empty() {
281286
let mut f = indented(f).with_str(INDENT);
282-
writeln!(f, "TODO:")?;
287+
writeln!(f, "{}", "TODO:".truecolor(0xae, 0xae, 0xae))?;
283288
for change in changes {
284-
writeln!(f, " - {}", change)?;
289+
writeln!(f, " - {}", change.truecolor(0xae, 0xae, 0xae))?;
285290
}
286291
writeln!(f)?;
287292
}

0 commit comments

Comments
 (0)