options - java lib for parsing command line options


Java 1.5 introduces annotations and generics. Using these, options allows you to handle command line option parsing with very little effort. A simple example:

public class SimpleExample {
          documentation="Name of the instance to create.")
  public String name;

  public static void main(String[] args) {
    SimpleExample me = new SimpleExample();
    OptionParser<SimpleExample> parser = 
            new OptionParser<SimpleExample>(me);
    try {
    } catch (OptionParseException e) {
    System.out.println("Name: " + me.name);

The point of this, apart from being compact, is that it does not intrude on the structure of your classes: no sub-classing, no interfaces to implement.


Learn more here:


v1.1.1 (2015-07-06)

  • Allow private classes as value parsers.

v1.1 (2013-06-08)

  • Allow extending parsing to arbitrary classes by adding custom value parsers.
  • Bug fix for "--"; argument parsing no longer automatically stops.
  • options now present in central repository.

Version history.

Download options from Maven central repository.

Or, if you are a follower of maven, you would endow your pom.xml thus:



Please feedback to options at quest windwards net.

options is released under GNU Lesser General Public License, version 3.