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.
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.