public static void main(String[] args) throws IOException, TemplateException {

    Options options = configureOptions();

    CommandLine line = null;

    try {

      CommandLineParser parser = new PosixParser();
      line = parser.parse(options, args);

      if (line.hasOption(HELP) || !line.hasOption(ROM)) {
        printHelp(options);
        System.exit(0);
      }
    } catch (ParseException e) {
      System.err.println(e.getMessage());
      printHelp(options);
      System.exit(1);
    }

    KurentoModuleCreator processor = new KurentoModuleCreator();
    processor.setDeleteGenDir(line.hasOption(DELETE));
    processor.setVerbose(line.hasOption(VERBOSE));
    processor.setOverwrite(!line.hasOption(NO_OVERWRITE));
    processor.setListGeneratedFiles(line.hasOption(LIST_GEN_FILES));

    if (line.hasOption(TEMPLATES_DIR)) {
      processor.setTemplatesDir(getTemplatesDir(line));
    } else if (line.hasOption(INTERNAL_TEMPLATES)) {
      processor.setInternalTemplates(line.getOptionValue(INTERNAL_TEMPLATES));
    }

    processor.setConfig(getConfigContent(line));
    processor.setKmdFilesToGen(getKmdFiles(line));
    processor.setDependencyKmdFiles(getDependencyKmdFiles(line));
    processor.setOutputFile(getOutputModuleFile(line));

    processor.setGenerateMavenPom(line.hasOption(GENERATE_MAVEN));
    processor.setGenerateNpmPackage(line.hasOption(GENERATE_NPM));

    showValues(processor, line);
    printSimpleKmd(processor, line);

    processor.setCodeGenDir(getCodegenDir(line));

    Result result = processor.generateCode();

    if (result.isSuccess()) {
      System.out.println("Generation success");
    } else {
      System.out.println("Generation failed");
      result.showErrorsInConsole();
      System.exit(1);
    }
  }