testing: Allow enabling only timestamps without verbose command output

-t enables only the timestamps, -v additionally logs command output
(includes -t).
This commit is contained in:
Tobias Brunner
2018-11-21 14:32:25 +01:00
parent 2132031d0e
commit c7a74fd3e5
+6 -2
View File
@@ -51,11 +51,15 @@ subdir_cnt="0"
############################################################################## ##############################################################################
# parse optional arguments # parse optional arguments
# #
while getopts "v" opt while getopts "vt" opt
do do
case "$opt" in case "$opt" in
v) v)
verbose=YES verbose=YES
timestamps=YES
;;
t)
timestamps=YES
;; ;;
esac esac
done done
@@ -64,7 +68,7 @@ shift $((OPTIND-1))
function print_time() function print_time()
{ {
[ "$verbose" == "YES" ] && echo "$(date +%T.%N) ~ " [ "$timestamps" == "YES" ] && echo "$(date +%T.%N) ~ "
} }
############################################################################## ##############################################################################