I have created a script which takes parameters and arguments. I want to insert the --help argument.
I already know how to parse normal arguments with -, but I don't know how to parse the -- ones.
To parse options for test.sh -h, I use the following check:
while getopts ":h" opt;
do
case $opt in
h ) {
echo "help!!!"
exit 1
} ;;
esac
done
But I want to have the option to call the script with test.sh --help.
P.S. I am using Ubuntu 12.04… but it doesn't really matter.