title: Argparse - do not catch positional arguments with `nargs`.
body: <p>I am trying to write a function wo which you can parse a variable amount of arguments via argparse - I know I can do this via <code>nargs="+"</code>. Sadly, the way argparse help works (and the way people generally write arguments in the CLI) puts the positional arguments last. This leads to my positional argument being caught as part of the optional arguments.</p>
  
  <pre><code>#!/usr/bin/python
  import argparse
  
  parser = argparse.ArgumentParser()
  parser.add_argument("positional", help="my positional arg", type=int)
  parser.add_argument("-o", "--optional", help="my optional arg", nargs='+', type=float)
  args = parser.parse_args()
  print args.positional, args.optional
  </code></pre>
  
  <p>running this as <code>./test.py -h</code> shows the following usage instruction:</p>
  
  <pre><code>usage: test.py [-h] [-o OPTIONAL [OPTIONAL ...]] positional
  </code></pre>
  
  <p>but if I run <code>./test.py -o 0.21 0.11 0.33 0.13 100</code> gives me </p>
  
  <pre><code>test.py: error: too few arguments
  </code></pre>
  
  <p>to get a correct parsing of args, I have to run <code>./test.py 100 -o 0.21 0.11 0.33 0.13</code></p>
  
  <p>So how do I:</p>
  
  <ul>
  <li><p>make argparse reformat the usage output so that it is less misleading, OR, even better:</p></li>
  <li><p>tell argparse to not catch the last element for the optional argument <code>-o</code> if it is the last in the list</p></li>
  </ul>
  
  <p>?</p>