Announcing argparse 0.5
-----------------------

argparse home:
   http://argparse.python-hosting.com/

argparse single module download:
   http://argparse.python-hosting.com/file/trunk/argparse.py?format=raw

argparse bundled downloads at PyPI:
   http://www.python.org/pypi/argparse/

About this release
==================

This release adds support for required options, better support for
opening files (deprecating the 'outfile' type), better control over
help formatting and better support for negative number arguments.

New in this release
===================

* Required options may now be created by specifying required=True in
calls to add_argument.
  http://argparse.python-hosting.com/wiki/ArgumentParser/add_argument/required

* The 'outfile' type has been deprecated. Use the new FileType factory
which can be used to specify both file mode and buffer size, and knows
how to convert '-' into sys.stdin or sys.stout as appropriate. The
'outfile' type will be removed in a future release.
  http://argparse.python-hosting.com/wiki/FileType

* The ArgumentParser constructor now accepts a ``formatter_class``
keyword argument which can be set to
argparse.RawDescriptionHelpFormatter to keep argparse from
line-wrapping your description.

* The algorithm in parse_args() has been enhanced to understand that
negative numbers are usually positional arguments, not misspelled
optional arguments.

About argparse
==============

The argparse module is an optparse-inspired command line parser that
improves on optparse by:

* handling both optional and positional arguments
* supporting parsers that dispatch to sub-parsers
* producing more informative usage messages
* supporting actions that consume any number of command-line args
* allowing types and actions to be specified with simple callables
instead of hacking class attributes like STORE_ACTIONS or
CHECK_METHODS

as well as including a number of other more minor improvements on the
optparse API. To whet your appetite, here's a simple program that sums
its command-line arguments and writes them to a file::

    parser = argparse.ArgumentParser()
    parser.add_argument('integers', nargs='+', type=int)
    parser.add_argument('--log', default=sys.stdout,
                        type=argparse.FileType('w'))
    args = parser.parse_args()
    args.log.write('%s\n' % sum(args.integers))
    args.log.close()
-- 
http://mail.python.org/mailman/listinfo/python-announce-list

        Support the Python Software Foundation:
        http://www.python.org/psf/donations.html

Reply via email to