Skip to content

Commit

Permalink
Add the -D/--debug option to the main script
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiz96 committed Mar 22, 2024
1 parent 21fe1db commit f4e3466
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/script/arch-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ _name="Arch-Update"
version="1.13.0"
option="${1}"

# Display debug traces if the -D/--debug argument is passed
for arg in "${@}"; do
case "${arg}" in
-D|--debug)
set -x
;;
esac
done

# Reset the option var if it is equal to -D/--debug (to avoid false negative "invalid option" error)
case "${option}" in
-D|--debug)
unset option
;;
esac

# Declare necessary parameters for translations
# shellcheck disable=SC1091
. gettext.sh
Expand Down Expand Up @@ -658,4 +674,3 @@ case "${option}" in
invalid_option
;;
esac

0 comments on commit f4e3466

Please sign in to comment.