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
|
# 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) ~ "
|
||||||
}
|
}
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user