From 0994472806521eed9ab3f90da6ed94a9cb284d35 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Fri, 17 May 2013 18:25:59 +0200 Subject: Add "precolorize" to pipeline to highlight "I'm assignee" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- watch-bz | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/watch-bz b/watch-bz index aa5ac32..8819f0c 100755 --- a/watch-bz +++ b/watch-bz @@ -41,9 +41,12 @@ BZPASSWORD= # Fedora and color-friendly watch: rhbz#801626 WATCHCMD=watch +PRECOLORIZE=cat COLORIZE=cat if watch --color -n0.1 -g date &>/dev/null; then WATCHCMD='watch --color' + PRECOLORIZE="sed" + PRECOLORIZE+=" -e 's|\( [NAPMQDVRC] \)\(.*\)\([\{]${BZUSER}[\}]\)|\x1b[1;31m\1\x1b[0m\2|'" COLORIZE="sed" COLORIZE+=" -e 's|\([0-9.A-Z]\++[, ]\)|\x1b[1;32m\1\x1b[0m|g'" COLORIZE+=" -e 's|\([0-9.A-Z]\+-[, ]\)|\x1b[33m\1\x1b[0m|g'" @@ -78,9 +81,9 @@ fi # omit component if only single one queried echo $COMPONENT | grep -q ',' if [ $? -eq 0 ]; then - OUTPUT_FMT="%{component}$SEP%{bug_id}$SEP%{product}$SEP%{priority}$SEP%{status}$SEP%{flags}$SEP%{short_desc}" + OUTPUT_FMT="%{component}$SEP%{bug_id}$SEP%{product}$SEP%{priority}$SEP%{status}$SEP%{flags}$SEP%{short_desc}\ \{%{assigned_to}\}" else - OUTPUT_FMT="%{bug_id}$SEP%{product}$SEP%{priority}$SEP%{status}$SEP%{flags}$SEP%{short_desc}" + OUTPUT_FMT="%{bug_id}$SEP%{product}$SEP%{priority}$SEP%{status}$SEP%{flags}$SEP%{short_desc}\ \{%{assigned_to}\}" fi @@ -174,7 +177,7 @@ do_watch () { -e \"s|rhel-||g\" \ -e \"s|qe_test_coverage[?+-][,]\?||\" \ -e \"s|None||\" \ - | ${HERE}/table-data $SEP | sort | cut -c-$WIDTH | ${COLORIZE}" + | ${HERE}/table-data $SEP | sort | ${PRECOLORIZE} | cut -c-$WIDTH | ${COLORIZE}" } do_init -- cgit