mirror of https://github.com/CISOfy/lynis.git
Allow show-warnings-only and --(show-)warnings-only option
This commit is contained in:
parent
3e20c1e30b
commit
2f07fa1d87
|
@ -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=""
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
################################################################################
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in New Issue