use of com.github.checkstyle.data.CompareMode in project contribution by checkstyle.
the class Main method parseCliToPojo.
/**
* Forms POJO containing input paths.
*
* @param commandLine
* parsed CLI.
* @return POJO instance.
* @throws IllegalArgumentException
* on failure to find necessary arguments.
*/
private static CliPaths parseCliToPojo(CommandLine commandLine) throws IllegalArgumentException {
final CompareMode compareMode = getCompareMode(OPTION_COMPARE_MODE, commandLine, CompareMode.XML);
final Path xmlBasePath = getPath(OPTION_BASE_REPORT_PATH, commandLine, null);
final Path xmlPatchPath = getPath(OPTION_PATCH_REPORT_PATH, commandLine, null);
final Path refFilesPath = getPath(OPTION_REFFILES_PATH, commandLine, null);
final Path defaultResultPath = Paths.get(System.getProperty("user.home")).resolve("XMLDiffGen_report_" + new SimpleDateFormat("yyyy.MM.dd_HH_mm_ss").format(Calendar.getInstance().getTime()));
final Path outputPath = getPath(OPTION_OUTPUT_PATH, commandLine, defaultResultPath);
final Path configBasePath = getPath(OPTION_BASE_CONFIG_PATH, commandLine, null);
final Path configPatchPath = getPath(OPTION_PATCH_CONFIG_PATH, commandLine, null);
final boolean shortFilePaths = commandLine.hasOption(OPTION_SHORT_PATHS);
return new CliPaths(compareMode, xmlBasePath, xmlPatchPath, refFilesPath, outputPath, configBasePath, configPatchPath, shortFilePaths);
}
Aggregations