Softhouse / jargo

Argument and options parser for java
Other
17 stars 0 forks source link

Arguments.run(Runnable).whenGiven("commit", ...) #20

Closed jontejj closed 11 years ago

jontejj commented 11 years ago

For simple Commands that doesn't need to handle arguments this would be a pretty easy thing to implement, yet very powerful.

Perhaps even CommandLinerParser.withCommands(Map<String, Runnable> commands) would be useful? Internally it would do Arguments.run(value).whenGiven(key) for each entry, runnable.toString() could be used as description.

Even CommandLinerParser.withCommands(Map<String, Runnable & Describable> commands), it would give the user the possibility to describe the commands as well.

Consider Arguments.commandArguments(Map<String, Runnable & Describable> commands) as well to allow users to set ignoreCase, hideFromUsage.