summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2012-03-09 20:54:29 +0100
committerJan Pokorný <jpokorny@redhat.com>2012-03-09 20:54:29 +0100
commit2d489206ff5462a0257147f6b200d2d713373662 (patch)
tree3664224f7ed85b941a9c0d44a844329a86149224
parenta94ad9f4c87f6dfb7a060201c6bd4c7023ffdfff (diff)
downloadwatch-bz-2d489206ff5462a0257147f6b200d2d713373662.tar.gz
watch-bz-2d489206ff5462a0257147f6b200d2d713373662.tar.xz
watch-bz-2d489206ff5462a0257147f6b200d2d713373662.zip
output component only if more of them required
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-xwatch-bz9
1 files 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 \