A lovely thing you can do with zsh is have an advanced option parser do the work for you: zparseopts!
zparseopts