Is there a good options parser framework/library for command-line programs written in Java? E.g. the equivalent of Python's optparse?
Check these out:
http://commons.apache.org/cli/
http://www.martiansoftware.com/jsap/
And, to roll your own:
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html
Take a look at the Commons CLI project, lots of good stuff in there.
Maybe these
JArgs command line option parsing suite for Java - this tiny project provides a convenient, compact, pre-packaged and comprehensively documented suite of command line option parsers for the use of Java programmers. Initially, parsing compatible with GNU-style 'getopt' is provided.
ritopt, The Ultimate Options Parser for Java - Although, several command line option standards have been preposed, ritopt follows the conventions prescribed in the opt package.
I've used JOpt and found it quite handy: http://jopt-simple.sourceforge.net/
The front page also provides a list of about 8 alternative libraries, check them out and pick the one that most suits your needs.
Yeap.
I think you're looking for something like this: http://commons.apache.org/cli
The Apache Commons CLI library provides an API for processing command line interfaces.
if you are familiar with gnu getopt, there is a java port at: http://www.urbanophile.com/arenn/hacking/download.htm. there appears to be a some classes that do this: http://docs.sun.com/source/816-5618-10/netscape/ldap/util/GetOpt.html, http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/xsltc/cmdline/getopt/GetOpt.html
You might find this meta-article of unhappiness interesting as a jumping off point:
http://furiouspurpose.blogspot.com/2008/07/command-line-parsing-libraries-for-java.html
Take a look at the more recent JCommander: http://beust.com/jcommander
(I created it, happy to answer questions or take feature requests)