I have adapted some code I had to handle just a single possible option. Either run the function or use the help option to give a brief description.
activate-jet ()
{
local iarg=0 narg="$#"
while (( narg > 0 )); do
opt="$1" ; iarg=$(( iarg + 1 ))
case $opt in
("-h"|"--help") echo "TODO" ; return ;;
(*) break ;;
esac
done
}
I would like to simplify it more if I can, without introducing any strange behaviour by the user when called.