[ANN] argparse 1.1 - Command-line parsing library

S

Steven Bethard

=======================
Announcing argparse 1.1
=======================
The argparse module provides an easy, declarative interface for
creating command line tools, which knows how to:
* parse the arguments and flags from sys.argv
* convert arg strings into objects for your program
* format and print informative help messages
* and much more...

The argparse module improves on the standard library optparse module
in a number of ways including:
* handling positional arguments
* supporting sub-commands
* allowing alternative option prefixes like + and /
* handling zero-or-more and one-or-more style arguments
* producing more informative usage messages
* providing a much simpler interface for custom types and actions

Download argparse
=================
The argparse homepage has links for source, MSI and single file
distributions of argparse:
http://code.google.com/p/argparse/

About this release
==================
This is the final release of argparse before its move to the Python
2.7 and 3.2 standard libraries. Major enhancements in this release:

* ArgumentParser(..., version=XXX) is deprecated. Instead, you should
use add_argument(..., action='version') which is more flexible and
does not force you to accept -v/--version as your version flags.

* Usage and help (but not version) messages are now written to stdout
instead of stderr, consistent with most existing programs.

* User defined types passed as a type= argument can now raise an
ArgumentTypeError to provide a custom error message.

* Namespace objects now support containment, e.g. "'foo' in args".

Various bugs were also squashed, e.g. "from argparse import *" now
works. See the news file for detailed information:

http://argparse.googlecode.com/svn/tags/r11/NEWS.txt

Enjoy!

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top