title: Python: How to make an option to be required in optparse?
body: <p>I've read this <a href="http://docs.python.org/release/2.6.2/library/optparse.html" rel="noreferrer">http://docs.python.org/release/2.6.2/library/optparse.html</a></p>
  
  <p>But I'm not so clear how to make an option to be required in optparse?</p>
  
  <p>I've tried to set "required=1" but I got an error:</p>
  
  <blockquote>
    <p>invalid keyword arguments: required</p>
  </blockquote>
  
  <p>I want to make my script require <code>--file</code> option to be input by users.  I know that the <code>action</code> keyword gives you error when you don't supply value to <code>--file</code> whose <code>action="store_true"</code>.</p>