title: Converting optparse to argparse
body: <p>Using optparse, I currently have:</p>
  
  <pre><code>opts, args = parser.parse_args(sys.argv[1:])
  </code></pre>
  
  <p>which is then feeding into a function that accepts opts:</p>
  
  <pre><code>func(opts,sys.argv)
  </code></pre>
  
  <p>I'm trying to now use argparse, but the formatting for argparse is different:</p>
  
  <pre><code>args = parser.parse_args(sys.argv[1:])
  </code></pre>
  
  <p>which doesn't allow me to feed the opts into the function. </p>
  
  <p>I was wondering if there's any way to use argparse while maintaining opts to feed into the function.</p>
  
  <p>I'm using Python 2.7.</p>