I reverted back to the original script, I'll just put my modified one in /usr/local/bin on my machines (hooray for configuration management!). I guess a more complex script that parses the command line might work, although I'm not much of a shell scripter.