title: Limit number of arguments passed in
body: <p>I am using <code>argparse</code> to take a list of input files:</p>
  
  <pre><code>import argparse
  p = argparse.ArgumentParser()
  p.add_argument("infile", nargs='+', type=argparse.FileType('r'),  help="copy from")
  p.add_argument("outfile", help="copy to")
  args = p.parse_args()
  </code></pre>
  
  <p>However, this opens the door for user to pass in <code>prog /path/to/* outfile</code>, where the source directory could potentially have millions of file, the shell expansion can overrun the parser. My questions are: </p>
  
  <ol>
  <li><p>is there a way to disable the shell expansion (*) within? </p></li>
  <li><p>if not, if there a way to put a cap on the number of input files before it is assembled into a list?</p></li>
  </ol>