title: How do I parse argparse arguments into a list of strings, stopping on a predefined flag argument?
body: <p>How can I parse variable length argument lists delimited by special predefined syntax. An example:</p>
  
  <pre><code>   ./script --arg1 --cmdname otherscript --a1 --a2 --cmdname-- --arg3
  </code></pre>
  
  <p>After parsing with <code>argparse</code> script should have three arguments: <code>arg1</code>, <code>cmdname</code>, <code>arg3</code>. The argument <code>cmdname</code> should consist of a list of three values <code>otherscript</code>, <code>a1</code>, <code>a2</code>.</p>
  
  <p>Having such a recipe would be useful to be able to pass on everything in <code>cmdname</code> into a <code>subprocess.popen(cmdname, ...)</code> call.</p>
  
  <p>I was thinking about subparsers. But I believe a subparser cannot be stopped, and really is mutually exclusive with other subparsers. Any other easy, already provided way? Is subclassing the <code>Action</code> the way to do it?</p>