summaryrefslogtreecommitdiff
path: root/src/ostree/main.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2018-03-19 09:46:20 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-19 17:15:27 +0000
commit01717d7dfc516989f483ad729111793dce934789 (patch)
treef247645a016559168c6526f6b5e2f7dd5b9659fd /src/ostree/main.c
parentd4d193495f488e71ea89f97f17bd030a6669c61e (diff)
downloadostree-01717d7dfc516989f483ad729111793dce934789.tar.gz
main, status: Factor out deployment printing into helper
Prep for staged deployments; they won't be in the primary deployment list, and we want to print them first. Also pull in some code from rpm-ostree for the red/bold bits and use that tree-wide. Update submodule: libglnx Closes: #1504 Approved by: jlebon
Diffstat (limited to 'src/ostree/main.c')
-rw-r--r--src/ostree/main.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/ostree/main.c b/src/ostree/main.c
index ddf531d1..9ed0f880 100644
--- a/src/ostree/main.c
+++ b/src/ostree/main.c
@@ -141,15 +141,10 @@ main (int argc,
if (error != NULL)
{
- int is_tty = isatty (1);
- const char *prefix = "";
- const char *suffix = "";
- if (is_tty)
- {
- prefix = "\x1b[31m\x1b[1m"; /* red, bold */
- suffix = "\x1b[22m\x1b[0m"; /* bold off, color reset */
- }
- g_printerr ("%serror: %s%s\n", prefix, suffix, error->message);
+ g_printerr ("%s%serror:%s%s %s\n",
+ ot_get_red_start (), ot_get_bold_start (),
+ ot_get_bold_end (), ot_get_red_end (),
+ error->message);
}
return ret;