title: Python argparse command line flags without arguments
body: <p>How do I add an optional flag to my command line args?</p>
  
  <p>eg. so I can write </p>
  
  <pre><code>python myprog.py 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>python myprog.py -w
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>parser.add_argument('-w')
  </code></pre>
  
  <p>But I just get an error message saying </p>
  
  <pre><code>Usage [-w W]
  error: argument -w: expected one argument
  </code></pre>
  
  <p>which I take it means that it wants an argument value for the -w option. What's the way of just accepting a flag? </p>
  
  <p>I'm finding <a href="http://docs.python.org/library/argparse.html">http://docs.python.org/library/argparse.html</a> rather opaque on this question.</p>