Optimized help text on screen when running Lynis without any arguments

This commit is contained in:
mboelen 2016-04-12 21:59:00 +02:00
parent 8a35eed518
commit 3e38d2fae5
1 changed files with 33 additions and 27 deletions

60
lynis
View File

@ -372,43 +372,51 @@ ${YELLOW}Note: ${WHITE}Cancelling the program can leave temporary files behind${
if [ ${PARAMCOUNT} -eq 0 -o ${WRONGOPTION} -eq 1 -o ${VIEWHELP} -eq 1 ]; then
printf "%s" "
Usage: lynis ${WHITE}[options] ${CYAN}mode${NORMAL}
${GREEN}Usage:${NORMAL} lynis ${CYAN}command ${WHITE}[options]${NORMAL}
${CYAN}Mode:${NORMAL}
${WHITE}Command:${NORMAL}
${GREEN}audit${NORMAL}
${CYAN}audit${NORMAL}
audit system : Perform security scan
audit dockerfile <file> : Analyze Dockerfile
${GREEN}update${NORMAL}
${CYAN}show${NORMAL}
show : Show all options
show version : Show ${PROGRAM_NAME} version
show help : Show help
${CYAN}update${NORMAL}
update info : Show update details
update release : Update Lynis release
${WHITE}Scan options:${NORMAL}
--auditor \"<name>\" : Auditor name
--dump-options : See all available options
--no-log : Don't create a log file
--pentest : Non-privileged scan (useful for pentest)
--profile <profile> : Scan the system with the given profile file
--quick (-Q) : Quick mode, don't wait for user input
--tests \"<tests>\" : Run only tests defined by <tests>
--tests-category \"<category>\" : Run only tests defined by <category>
${WHITE}Options:${NORMAL}
${WHITE}Layout options:${NORMAL}
--no-colors : Don't use colors in output
--quiet (-q) : No output, except warnings
--reverse-colors : Optimize color display for light backgrounds
${BLUE}--auditor ${BROWN}\"<name>\"${NORMAL} : Auditor name
${BLUE}--dump-options${NORMAL} : See all available options
${BLUE}--no-log${NORMAL} : Don't create a log file
${BLUE}--pentest${NORMAL} : Non-privileged scan (useful for pentest)
${BLUE}--profile ${BROWN}<profile>${NORMAL} : Scan the system with the given profile file
${BLUE}--quick (-Q)${NORMAL} : Quick mode, don't wait for user input
${BLUE}--tests ${BROWN}\"<tests>\"${NORMAL} : Run only tests defined by <tests>
${BLUE}--tests-category ${BROWN}\"<category>\"${NORMAL} : Run only tests defined by <category>
${WHITE}Misc options:${NORMAL}
--debug : Debug logging to screen
--view-manpage (--man) : View man page
--version (-V) : Display version number and quit
${GRAY}Layout options${NORMAL}
${BLUE}--no-colors${NORMAL} : Don't use colors in output
${BLUE}--quiet (-q)${NORMAL} : No output, except warnings
${BLUE}--reverse-colors${NORMAL} : Optimize color display for light backgrounds
${WHITE}Enterprise options:${NORMAL}
--plugin-dir \"<path>\" : Define path of available plugins
--upload : Upload data to central node
${GRAY}Misc options${NORMAL}
${BLUE}--debug${NORMAL} : Debug logging to screen
${BLUE}--view-manpage (--man)${NORMAL} : View man page
${BLUE}--version (-V)${NORMAL} : Display version number and quit
${GRAY}Enterprise options${NORMAL}
${BLUE}--plugin-dir ${BROWN}\"<path>\"${NORMAL} : Define path of available plugins
${BLUE}--upload${NORMAL} : Upload data to central node
More options available. Run 'lynis show options', or use the man page.
"
@ -416,12 +424,10 @@ ${YELLOW}Note: ${WHITE}Cancelling the program can leave temporary files behind${
echo " ${RED}Error${NORMAL}: ${WHITE}Invalid option '${WRONGOPTION_value}'${NORMAL}"
else
if [ ${VIEWHELP} -eq 0 ]; then
echo " ${RED}Error${NORMAL}: ${WHITE}No scanning mode specified!${NORMAL}"
echo " ${RED}Error${NORMAL}: ${WHITE}No command specified.${NORMAL} Exiting.."
fi
fi
echo " More scan options are available. See man page and online documentation for details."
echo ""
echo "Exiting.."
# Cleanup PID file if we drop out earlier
RemovePIDFile
# Exit with exit code 1