diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2016-07-05 18:25:19 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2016-07-05 18:25:19 +0300 |
commit | 75786a1c80ba783c5552c837930aaba11f74c3fb (patch) | |
tree | 6ccabe9dc4dbe67a9ea18b1dd8f57f381f4ee58d /include/functions | |
parent | cb73cbb968f47a83193175ea46bb73e4233a854e (diff) |
Added DisplayToolTip
Diffstat (limited to 'include/functions')
-rw-r--r-- | include/functions | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/include/functions b/include/functions index 89b970e5..66b20715 100644 --- a/include/functions +++ b/include/functions @@ -39,6 +39,7 @@ # DiscoverProfiles Determine available profiles on system # Display Output text to screen with colors and identation # DisplayManual Output text to screen without any layout +# DisplayToolTip Show a tip for improving usage of the tool # ExitClean Stop the program (cleanly), with exit code 0 # ExitCustom Stop the program (cleanly), with custom exit code # ExitFatal Stop the program (cleanly), with exit code 1 @@ -444,6 +445,27 @@ ################################################################################ + # Name : DisplayToolTip() + # Description : Show tooltip on screen + # + # Input : $1 = text + # Returns : <nothing> + ################################################################################ + + DisplayToolTip() { + if [ ${SHOW_TOOL_TIPS} -eq 1 ]; then + if [ ${CRONJOB} -eq 0 ]; then + # Check if we already have already discovered a proper echo command tool. It not, set it default to 'echo'. + if [ "${ECHOCMD}" = "" ]; then ECHOCMD="echo"; fi + ${ECHOCMD} "${WHITE}[${BLUE}Tool Tip${NORMAL}${WHITE}]${NORMAL}: $1" + else + echo "${TEXT}${RESULTPART}" + fi + fi + } + + + ################################################################################ # Name : Display() # Description : Show text on screen, with markup # @@ -537,6 +559,27 @@ ################################################################################ + # Name : DisplayToolTip() + # Description : Show tooltip on screen + # + # Input : $1 = text + # Returns : <nothing> + ################################################################################ + + DisplayToolTip() { + if [ ${SHOW_TOOL_TIPS} -eq 1 ]; then + if [ ${CRONJOB} -eq 0 ]; then + # Check if we already have already discovered a proper echo command tool. It not, set it default to 'echo'. + if [ "${ECHOCMD}" = "" ]; then ECHOCMD="echo"; fi + ${ECHOCMD} "${WHITE}[${BLUE}TOOLTIP${NORMAL}${WHITE}]${NORMAL} ${WHITE}$1${NORMAL}" + else + echo "${TEXT}${RESULTPART}" + fi + fi + } + + + ################################################################################ # Name : ExitClean() # Description : Perform a normal exit of the program, and clean up resources # |