args4j is a small Java class library that makes it easy to parse command line options/arguments in your CUI application. See more info at [http://args4j.kohsuke.org/]
See the quick intro