title: Argparse not recognized and incorrectly handled
body: <p>I have some problems using argparse. I want to have a set of names I can define on the command line which will influence the program's behaviour. I tried the following snippet:</p>
  
  <pre><code>import argparse
  parser = argparse.ArgumentParser()
  parser.add_argument("allon", action='store_true', default = False,
                      help="Toggles all output pins to ON.")
  parser.add_argument("alloff",action='store_true',
                      help="Toggles all output pins to OFF.")
  parser.add_argument("cont", action='store_true',
                      help="Toggles all output pins continously on and off.")
  args = parser.parse_args()
  
  if args.allon:
     do_allon()
  elif args.alloff:
      do_alloff()
  ....
  </code></pre>
  
  <p>but the code's behavious is anything than expected. I do not want to use the '--' for those options, as I want to call my code like <code>git status</code> (without the leading '--').</p>
  
  <p>First, if I call the code without arguments all the arguments are set to True, while I want them to be set to False if they are not given. The expected behaviour is as follows: When calling as</p>
  
  <pre><code>python code.py
  </code></pre>
  
  <p>I want <code>allon, alloff</code> and <code>cont</code> to be set to <code>False</code>, while when calling as</p>
  
  <pre><code>python code.py alloff
  </code></pre>
  
  <p>I want <code>allon</code> and <code>cont</code> to be <code>False</code> while <code>alloff</code> set to be <code>True</code>.</p>
  
  <p>Second, when I call e.g. <code>python code.py allon</code> I get </p>
  
  <pre><code>code.py: error: unrecognized arguments: allon
  </code></pre>
  
  <p>which I don't understand at all. I know how to use optparse, but help with argparse is greatly appreciated to get the above snippet working.</p>
  
  <p>Thanks
    Alex</p>
  
  <p>P.S. The if-loop is just educational, not actually implemented that way.</p>