while getopts ":help :a" opt; do
case $opt in
help)
echo "-p to print";
;;
....
I run it like this.
myscript -help
Help doesn’t get called, I do not know why…
If I change help with just h and start the script like this everything works just fine.
myscript -h
What is my problem?
This is non-standard syntax. The option
-helpwould be just a shortcut for-h -e -l -p. Note that most commands have one-character options with dash (-h) and long names with double dash (--help).