title: Argparse optional required arguments produce error if missing, but the action is still performed
body: <p>I have the following snippet:</p>
  
  <pre><code>import argparse
  
  parser = argparse.ArgumentParser()
  parser.add_argument('--p', required=True)
  parser.add_argument('arg', action=MyAction)
  parser.parse_args()
  </code></pre>
  
  <p>, where <code>MyAction</code> is a simple custom action class.</p>
  
  <p>As you see, I want to enforce the presence of the <code>p</code> argument. However, my action is performed even if the argument is not present, and then an error message is shown that indicates the fact the the argument is missing.</p>
  
  <p>Obviously, I could check in my action class for the presence of the <code>p</code> argument, but this defies the purpose of having a <code>required</code> parameter in the first place. Why is my action being run if the argument is not present?</p>