When the for loop gets to "pattern", it is not covered by a case branch so it hits the default branch and prints the help. You have to iterate over the arguments in a smarter way. Replace for for
loop with
while (( $# > 0 )); do
arg=$1
shift
case $arg in
--string) STRING=$1; shift; echo "$STRING" ;;
--some-command) : ;;
--) break ;;
*) print_help; exit ;;
esac
done