Abstract
Addition to optparse to automatically parse and store the arguments.
Table of Contents
Addition to optparse to automatically parse and store the arguments.
This module provides a new class OptionParserWithArgs() that allows specifying the contents of the arguments (always non-optional) and that places the results on the resulting options container object rather than return the arguments.
Use it like this:
import optparse_wargs as optparse ... parser = optparse.OptionParserWithArgs(...) ... parser.add_argument('dbname', 'The database name to work on.') parser.add_argument('dumpfile', 'The dump file to work on.') opts = parser.parse_args() # Use opts.dbname, opts.dumpfile, ...
Important
This computer program or library is provided for free. I am aware that some of the programs that I provide for free allow people to get their work done faster or better, save them time and money. If you are using this program for benefit, especially if you are using it within a commercial environment and it saves you time or work, please consider making a donation by sending me a book from my Amazon Wishlist or by a direct donation to my company's PayPal account by clicking on the link below.