I'm trying to get simple option handling in my ruby app. Looks like OptionParser
does most of what I want, though I can't figure out a way to gracefully handle unexpected arguments.
If any unexpected arguments are provided I want to treat it as if the -h
argument was passed (show usage and quit). I'm not seeing any way to handle that though.
If OptionParser
can't do it, is there another library I could use for easily parsing command line arguments?