I write a little command-line-application in Java. This application should work with a mix of parameters and commands, similar to svn.
Examples
app url command1
app url command2 --parameter2 -x
app url command1 --param-with-argument argument
app --parameter url command1
app --no-url command2
app --help
Wanted
Exists an easy-to-use library for Java
Supports parsing of such command-lines
(Bonus) Automatically creates an appropriate help
解决方案
I'm a fan of Commons CLI.
You can set it to understand commands, flags (with short and long names), whether or not certain commands/switches are required, or if they have default values. It even has functionality to print out a useful --help type message.
The Usage Scenarios page has some good examples of how it can be used.