Add infos in debug messages

This commit is contained in:
Jeremy Gardais 2022-12-01 10:40:38 +01:00
parent bdf560fab8
commit 6c44f0ec37
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 11 additions and 7 deletions

View File

@ -42,7 +42,6 @@ OPTIONS:
-h,--help -h,--help
Print this help message. Print this help message.
HELP HELP
} }
@ -79,11 +78,15 @@ define_vars() { # {{{
#fi #fi
## }}} ## }}}
true; ## Remove me
} }
# }}} # }}}
main() { # {{{ main() { # {{{
debug_message "--- MAIN BEGIN"
## If script should not be executed right now {{{ ## If script should not be executed right now {{{
### Exit ### Exit
is_script_ok \ is_script_ok \
@ -92,7 +95,9 @@ main() { # {{{
## Define all vars ## Define all vars
define_vars define_vars
debug_message "| Define vars"
debug_message "--- MAIN END"
} }
# }}} # }}}
@ -120,6 +125,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
case "${1}" in case "${1}" in
-d|--debug ) ## debug -d|--debug ) ## debug
DEBUG=0 DEBUG=0
debug_message "--- Manage argument BEGIN"
;; ;;
-h|--help ) ## help -h|--help ) ## help
usage usage
@ -140,8 +146,7 @@ if [ ! "${NBARGS}" -eq "0" ]; then
;; ;;
esac esac
debug_message "Arguments management \ debug_message "| ${RED}${1}${COLOR_DEBUG} option managed."
${RED}${1}${COLOR_DEBUG} option managed."
## Move to the next argument ## Move to the next argument
shift shift
@ -149,13 +154,12 @@ ${RED}${1}${COLOR_DEBUG} option managed."
done done
debug_message "Arguments management \ debug_message "| ${RED}${manage_arg}${COLOR_DEBUG} argument(s) successfully managed."
${RED}${manage_arg}${COLOR_DEBUG} argument(s) successfully managed."
else else
debug_message "Arguments management \ debug_message "| No arguments/options to manage."
No arguments/options to manage."
fi fi
debug_message "--- Manage argument END"
# }}} # }}}
main main