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:
+6
-2
@@ -51,11 +51,15 @@ subdir_cnt="0"
|
||||
##############################################################################
|
||||
# parse optional arguments
|
||||
#
|
||||
while getopts "v" opt
|
||||
while getopts "vt" opt
|
||||
do
|
||||
case "$opt" in
|
||||
v)
|
||||
verbose=YES
|
||||
timestamps=YES
|
||||
;;
|
||||
t)
|
||||
timestamps=YES
|
||||
;;
|
||||
esac
|
||||
done
|
||||
@@ -64,7 +68,7 @@ shift $((OPTIND-1))
|
||||
|
||||
function print_time()
|
||||
{
|
||||
[ "$verbose" == "YES" ] && echo "$(date +%T.%N) ~ "
|
||||
[ "$timestamps" == "YES" ] && echo "$(date +%T.%N) ~ "
|
||||
}
|
||||
|
||||
##############################################################################
|
||||
|
||||
Reference in New Issue
Block a user