Allow show-warnings-only and --(show-)warnings-only option

This commit is contained in:
mboelen 2016-04-25 11:10:23 +02:00
parent 3e20c1e30b
commit 2f07fa1d87
4 changed files with 20 additions and 5 deletions

View File

@ -159,6 +159,7 @@ unset LANG
SHOW_PROGRAM_DETAILS=1
SHOW_REPORT=1
SHOW_SETTINGS_FILE=0
SHOW_WARNINGS_ONLY=0
SKIP_TESTS=""
SKIPPED_TESTS_ROOTONLY=""
SSHKEYSCANBINARY=""

View File

@ -440,8 +440,7 @@
# Returns : Nothing
################################################################################
Display()
{
Display() {
INDENT=0; TEXT=""; RESULT=""; COLOR=""; SPACES=0; SHOWDEBUG=0
while [ $# -ge 1 ]; do
case $1 in
@ -489,8 +488,11 @@
fi
if [ ! "${TEXT}" = "" ]; then
# Show warnings always, and other messages if no quiet is being used
if [ ${QUIET} -eq 0 -o "${RESULT}" = "WARNING" ]; then
local SHOW=0
if [ ${QUIET} -eq 0 ]; then SHOW=1; fi
if [ "${RESULT}" = "WARNING" -a ${SHOW_WARNINGS_ONLY} -eq 1 ]; then SHOW=1; fi
if [ ${SHOW} -eq 1 ]; then
# Display (counting with -m instead of -c, to support language locale)
LINESIZE=`echo "${TEXT}" | wc -m | tr -d ' '`
if [ ${SHOWDEBUG} -eq 1 ]; then DEBUGTEXT=" [${PURPLE}DEBUG${NORMAL}]"; else DEBUGTEXT=""; fi
@ -504,7 +506,7 @@
fi
fi
fi
}
}
################################################################################

View File

@ -303,6 +303,11 @@
fi
;;
# Warnings
--warnings-only | --show-warnings-only)
SHOW_WARNINGS_ONLY=1
;;
# Drop out when using wrong option(s)
*)
# Wrong option used, we bail out later

View File

@ -175,6 +175,13 @@
SHOW_TOOL_TIPS="${VALUE}"
;;
# Show warnings only
show-warnings-only)
SHOW_WARNINGS_ONLY=1
FIND=`echo "${VALUE}" | egrep "^(1|yes)"` && SHOW_WARNINGS_ONLY=1
Debug "Show warnings only set to ${SHOW_WARNINGS_ONLY}"
;;
# Which tests to skip (skip-test=ABCD-1234 or skip-test=ABCD-1234:subtest)
skip-test)
SKIP_TESTS="${SKIP_TESTS} ${VALUE}"