I think maybe you want this to say 

```
if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then
```

One thing is this will only detect if `-h` or `--help` is the _last_argument, but I think anything other than that is pretty tricky.