(from Dave's solution)

if __FILE__ == $0
   require 'optparse'

   # Look, James, I'm opt-parsing! :)
   ...

I'm so proud!  :D

James Edward Gray II