title: How to Loop over a optparse.OptionGroup values in python
body: <p>I'm trying to use optparse to make a command line tool in python
  I have a group of options optparse.OptionGroup that I wan't to loop over to do whatever... but how do I do that ?
  I have:</p>
  
  <pre><code>usage = ("polotools [options]")
  parser = optparse.OptionParser(version="polotools %s" % version, usage=usage)
  parser.add_option('--amrsim', dest='amrsim', action='store_true',
      help=('Set amr simulation mode, skips if not present'))    
  
  groupAMR = optparse.OptionGroup(parser,'AMR simulation:',
                  "ATENTION: use these options only with --amrsim")
  groupAMR.add_option('--Utility', dest='Utility', action='store',
      help=('Set utility rate for AMR simulation, accept dictionary'))
  
  parser.add_option_group(groupAMR)
  
  (options, args) = parser.parse_args()
  </code></pre>
  
  <p>But in options all options get grouped togheter.. and I wan't to filter only the ones in groupAMR.</p>