This is one quick and dirty method:
AAA=default
# example: BBB left unspecified so you can optionally override from environment
XYZ=${XYZ:-0} # optional so you could override from environment
ABC=${ABC:-0}
while test $# -gt 0 ; do
# switches
if test "$1" = "--flag-xyz" ; then XYZ=1 ; shift ; continue; fi
if test "$1" = "--flag-abc" ; then ABC=1 ; shift ; continue; fi
# options with arguments
case "$1" in
--option-aaa=*) AAA="${1##--option-aaa=}" ; shift; continue; break ;;
--option-bbb=*) BBB="${1##--option-bbb=}" ; shift; continue; break ;;
esac
# unknown - up to you - positional argument or error?
echo "Unknown option $1"
shift
done
Customise as required.
The advantage of this method is it is order independent, you can tweak options for edge cases in your syntax if needed. And it is simple otherwise.
If you need to enforce ordering break the processing into multiple statements with a break from the relevant while statement when needed.
Downside is there is a bit of the duplication that getopt sometimes avoids.
EDIT: change [==] and -gt to test