Like @bxparks, I have a template for my bash scripts command-line parsing, but I like to stick to GNU-style options and I find that Bash's getopts command handles all these cases without trouble:
command -ffilename -f filename --file=filename -- -f is not an option
My template is at https://gist.github.com/webb/ff380b0eee96dafe1c20c2a136d85ef....