There are several ways of dealing with this. If this is the only option, or if there are only a few, you may consider parsing it manually yourself. In shell-speak, all words after the shell command are called *parameters*, and each is assigned to a *positional parameter*, in the form `$n` with `n` starting at 1. Thus, you can perform a test to check whether `[[ $1 == "--nomail" ]]` and act accordingly. That's the simple straightforward way for only a single option.

For more complex shell scripts with many options, you may want to avail yourself of some form of `getopts` command to parse the options for you. The `bash` shell includes a version of `getopts` as a builtin, and you can learn more about it by typing `man bash` at the command line and then (if your default pager is set to `less`) `/^ *getopt`.