public static CommandLineParser generateCommandLineParser(Object paramInstance) throws CommandLineParserException {
return generateCommandLineParser(paramInstance.getClass());
}
public static CommandLineParser generateCommandLineParser(Class clazz) throws CommandLineParserException {
CommandDefinition command = (CommandDefinition) clazz.getAnnotation(CommandDefinition.class);
if(command == null)
throw new CommandLineParserException("Commands must be annotated with @CommandDefinition");
ProcessedCommand processedCommand = new ProcessedCommand(command.name(), command.description(),
command.validator(), command.resultHandler());
for(Field field : clazz.getDeclaredFields()) {
Option o;
OptionGroup og;
OptionList ol;