title: Arbitrary command line arguments in python
body: <p>I want to allow arbitrary command line arguments.  If the user provides me with a command line that looks like this</p>
  
  <p><code>myscript.py --a valueofa --b valueofb posarg1 posarg2</code></p>
  
  <p>I know that <code>a</code> was passed with <code>valueofa</code>, <code>b</code> passed with <code>valueofb</code> and that I have these last two positional arguments.  </p>
  
  <p>I've always used optparse, for which you specify exactly which arguments to look for.  But I want the user to be able to define arbitrary "macros" from the command line.  Surely there's a python module that does it more elegantly than anything I'd write.  What is?</p>