Mesa (master): aubinator: honor --color option when printing the header

Jordan Justen jljusten at kemper.freedesktop.org
Tue Jan 9 06:09:53 UTC 2018


Module: Mesa
Branch: master
Commit: 4f0a2ff4c12c7a7a45c7a360a67f82a859a9634e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f0a2ff4c12c7a7a45c7a360a67f82a859a9634e

Author: Scott D Phillips <scott.d.phillips at intel.com>
Date:   Tue Nov 28 15:52:08 2017 -0800

aubinator: honor --color option when printing the header

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

---

 src/intel/tools/aubinator.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/intel/tools/aubinator.c b/src/intel/tools/aubinator.c
index ed7446cf1e..46b0a47bcd 100644
--- a/src/intel/tools/aubinator.c
+++ b/src/intel/tools/aubinator.c
@@ -192,8 +192,12 @@ handle_trace_header(uint32_t *p)
    gen_batch_decode_ctx_init(&batch_ctx, &devinfo, outfile, batch_flags,
                              xml_path, get_gen_batch_bo, NULL);
 
+   char *color = GREEN_HEADER, *reset_color = NORMAL;
+   if (option_color == COLOR_NEVER)
+      color = reset_color = "";
+
    fprintf(outfile, "%sAubinator: Intel AUB file decoder.%-80s%s\n",
-           GREEN_HEADER, "", NORMAL);
+           color, "", reset_color);
 
    if (input_file)
       fprintf(outfile, "File name:        %s\n", input_file);




More information about the mesa-commit mailing list