title: how to get argparse to read arguments from a file with an option rather than prefix
body: <p>I would like to know how to use python's argparse module to read arguments both from the command line and possibly from text files. I know of argparse's <code>fromfile_prefix_chars</code> but that's not exactly what I want. I want the behavior, but I don't want the syntax. I want an interface that looks like this:</p>
  
  <pre><code>$ python myprogram.py --foo 1 -A somefile.txt --bar 2
  </code></pre>
  
  <p>When argparse sees -A, it should stop reading from sys.argv or whatever I give it, and call a function I write that will read somefile.text and return a list of arguments. When the file is exhausted it should resume parsing sys.argv or whatever. It's important that the processing of the arguments in the file happen in order (ie: -foo should be processed, then the arguments in the file, then -bar, so that the arguments in the file may override --foo, and --bar might override what's in the file). </p>
  
  <p>Is such a thing possible? Can I write a custom function that pushes new arguments onto argparse's stack, or something to that effect?</p>