Skip to content

Commit b30f668

Browse files
committed
Feat(cli): Cli Status Colors - Add colors to brackets and maintain bg
1 parent 8018126 commit b30f668

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/setup/states.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ pub struct ResourceSetupInfo<K, S, C: ResourceSetupStatusCheck> {
267267

268268
impl<K, S, C: ResourceSetupStatusCheck> std::fmt::Display for ResourceSetupInfo<K, S, C> {
269269
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
270+
let cyan = (0x5c, 0xe1, 0xe6);
270271
let status_code = match self.status_check.as_ref().map(|c| c.change_type()) {
271272
Some(SetupChangeType::NoChange) => "READY",
272273
Some(SetupChangeType::Create) => "TO CREATE",
@@ -275,11 +276,10 @@ impl<K, S, C: ResourceSetupStatusCheck> std::fmt::Display for ResourceSetupInfo<
275276
Some(SetupChangeType::Invalid) => "INVALID",
276277
None => "USER MANAGED",
277278
};
278-
// Colors
279-
let status_bg = status_code.on_truecolor(0x5c, 0xe1, 0xe6);
280-
let status_colored = status_bg.truecolor(0xff, 0xff, 0xff);
279+
let status_str = format!("[ {:^9} ]", status_code);
280+
let status_full = status_str.truecolor(cyan.0, cyan.1, cyan.2);
281281
let desc_colored = self.description.truecolor(0xff, 0xff, 0xff);
282-
writeln!(f, "[ {:^9} ] {}", status_colored, desc_colored)?;
282+
writeln!(f, "{} {}", status_full, desc_colored)?;
283283
if let Some(status_check) = &self.status_check {
284284
let changes = status_check.describe_changes();
285285
if !changes.is_empty() {

0 commit comments

Comments
 (0)