From 2d489206ff5462a0257147f6b200d2d713373662 Mon Sep 17 00:00:00 2001 From: Jan Pokorný Date: Fri, 9 Mar 2012 20:54:29 +0100 Subject: output component only if more of them required 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, 7 insertions(+), 2 deletions(-) diff --git a/watch-bz b/watch-bz index ee5864a..2655b68 100755 --- a/watch-bz +++ b/watch-bz @@ -17,8 +17,6 @@ STATUS=OPEN REFRESH_INTERVAL=600 # [s], better not to drain bugzilla's power... SEP=@@@ -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%{short_desc}" WIDTH=$(( $(stty size | cut -d' ' -f2) - 1 )) @@ -32,6 +30,13 @@ if [ $# -ge 1 ]; then fi fi +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}" +else + OUTPUT_FMT="%{bug_id}$SEP%{product}$SEP%{priority}$SEP%{status}$SEP%{flags}$SEP%{short_desc}" +fi + watch -t --interval $REFRESH_INTERVAL \ "$BUGZILLA query -c $COMPONENT -t $STATUS --outputformat $OUTPUT_FMT \ | sed -u \ -- cgit