title: Require either of two arguments using argparse
body: <p>Given:</p>
  
  <pre><code>import argparse
  
  pa = argparse.ArgumentParser()
  pa.add_argument('--foo')
  pa.add_argument('--bar')
  
  print pa.parse_args('--foo 1'.split())
  </code></pre>
  
  <p>how do I</p>
  
  <ul>
  <li>make at least one of "foo, bar" mandatory: <code>--foo x</code>, <code>--bar y</code> and <code>--foo x --bar y</code> are fine</li>
  <li>make at most one of "foo, bar" mandatory: <code>--foo x</code> or <code>--bar y</code> are fine, <code>--foo x --bar y</code> is not</li>
  </ul>