title: Using ruby's OptionParser to parse sub-commands
body: <p>I'd like to be able to use ruby's OptionParser to parse sub-commands of the form</p>
  
  <pre><code>COMMAND [GLOBAL FLAGS] [SUB-COMMAND [SUB-COMMAND FLAGS]]
  </code></pre>
  
  <p>like:</p>
  
  <pre><code>git branch -a
  gem list foo
  </code></pre>
  
  <p>I know I could switch to a different option parser library (like Trollop), but I'm interested in learning how to do this from within OptionParser, since I'd like to learn the library better.</p>
  
  <p>Any tips?</p>