#!/bin/bash
DESCRIPTION=""
# match all when not initialized
BUILD="_"
# $@ is all command line parameters passed to the script.
# -o is for short options like -v
# -l is for long options with double dash like --version
# the comma separates different long options
# -a is for long options with single dash like -version
options=$(getopt -l "help,description:,build:" -o ":hd:b:" -a -- "$@")
# set --:
# If no arguments follow this option, then the positional parameters are unset. Otherwise, the positional parameters
# are set to the arguments, even if some of them begin with a ‘-’.
eval set -- "$options"
while true
do
case $1 in
-h|--help) HELP=1;;
-d|--description)
shift
DESCRIPTION=$1
;;
-b|--build)
shift
BUILD=$1
;;
\?) echo "Invalid option: $2" 1>&2
HELP=1;;
--)
shift
break;;
esac
shift
done
echo "
Install ESPEasy ${DESCRIPTION}
To install ESPEasy, connect your ESP device to your computer, pick your
selected variant and click the install button.