From 3e38d2fae5d6db4a7c8eb9e9c676d522c522eb66 Mon Sep 17 00:00:00 2001 From: mboelen Date: Tue, 12 Apr 2016 21:59:00 +0200 Subject: [PATCH] Optimized help text on screen when running Lynis without any arguments --- lynis | 60 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/lynis b/lynis index f5209b25..611adcce 100755 --- a/lynis +++ b/lynis @@ -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 : 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 \"\" : Auditor name - --dump-options : See all available options - --no-log : Don't create a log file - --pentest : Non-privileged scan (useful for pentest) - --profile : Scan the system with the given profile file - --quick (-Q) : Quick mode, don't wait for user input - --tests \"\" : Run only tests defined by - --tests-category \"\" : Run only tests defined by + ${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}\"\"${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}${NORMAL} : Scan the system with the given profile file + ${BLUE}--quick (-Q)${NORMAL} : Quick mode, don't wait for user input + ${BLUE}--tests ${BROWN}\"\"${NORMAL} : Run only tests defined by + ${BLUE}--tests-category ${BROWN}\"\"${NORMAL} : Run only tests defined by - ${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 \"\" : 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}\"\"${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