From 7f7d063a7c0b050dbaa927335a9cb9056d3a66db Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Tue, 22 Jun 2021 17:14:21 -0500 Subject: [PATCH] trivial: fu-util-common: output UpdateError and UpdateMessage in colors This will make it easier to stand out when there is a problem or something to tell the user. --- src/fu-util-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fu-util-common.c b/src/fu-util-common.c index 1b9036f14..1ec2a3fed 100644 --- a/src/fu-util-common.c +++ b/src/fu-util-common.c @@ -1336,15 +1336,17 @@ fu_util_device_to_string (FwupdDevice *dev, guint idt) if (state == FWUPD_UPDATE_STATE_SUCCESS) { tmp = fwupd_device_get_update_message (dev); if (tmp != NULL) { + g_autofree gchar *color = fu_util_term_format (tmp, FU_UTIL_CLI_COLOR_BLUE); /* TRANSLATORS: helpful messages from last update */ - fu_common_string_append_kv (str, idt + 1, _("Update Message"), tmp); + fu_common_string_append_kv (str, idt + 1, _("Update Message"), color); } } } tmp = fwupd_device_get_update_error (dev); if (tmp != NULL) { + g_autofree gchar *color = fu_util_term_format (tmp, FU_UTIL_TERM_COLOR_RED); /* TRANSLATORS: error message from last update attempt */ - fu_common_string_append_kv (str, idt + 1, _("Update Error"), tmp); + fu_common_string_append_kv (str, idt + 1, _("Update Error"), color); } /* modified date: for history devices */