From 6c44f0ec37ff83500ad46845915839d309b709f8 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Thu, 1 Dec 2022 10:40:38 +0100 Subject: [PATCH] Add infos in debug messages --- templates/skeleton.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/templates/skeleton.sh b/templates/skeleton.sh index 7c5ca54..5b644a6 100755 --- a/templates/skeleton.sh +++ b/templates/skeleton.sh @@ -42,7 +42,6 @@ OPTIONS : -h,--help Print this help message. - HELP } @@ -79,11 +78,15 @@ define_vars() { # {{{ #fi ## }}} + + true; ## Remove me } # }}} main() { # {{{ + debug_message "--- MAIN BEGIN" + ## If script should not be executed right now {{{ ### Exit is_script_ok \ @@ -92,7 +95,9 @@ main() { # {{{ ## Define all vars define_vars + debug_message "| Define vars" + debug_message "--- MAIN END" } # }}} @@ -120,6 +125,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then case "${1}" in -d|--debug ) ## debug DEBUG=0 + debug_message "--- Manage argument BEGIN" ;; -h|--help ) ## help usage @@ -140,8 +146,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then ;; esac - debug_message "Arguments management − \ -${RED}${1}${COLOR_DEBUG} option managed." + debug_message "| ${RED}${1}${COLOR_DEBUG} option managed." ## Move to the next argument shift @@ -149,13 +154,12 @@ ${RED}${1}${COLOR_DEBUG} option managed." done - debug_message "Arguments management − \ -${RED}${manage_arg}${COLOR_DEBUG} argument(s) successfully managed." + debug_message "| ${RED}${manage_arg}${COLOR_DEBUG} argument(s) successfully managed." else - debug_message "Arguments management − \ -No arguments/options to manage." + debug_message "| No arguments/options to manage." fi + debug_message "--- Manage argument END" # }}} main