static String descr() { StringBuilder str = new StringBuilder(); for (FileType fileType : FileType.values()) { str.append(fileType.option); str.append(" ("); str.append(fileType.descr); str.append("), "); } return str.toString(); } }
opts.type = FileType.fromOption(cmd.getOptionValue(TYPE_OPTION)); opts.oplogs = cmd.hasOption(OP_LOG_OPTION); opts.cleanup = cmd.hasOption(CLEANUP_OPTION);
opts.type = FileType.fromOption(cmd.getOptionValue(TYPE_OPTION)); opts.oplogs = cmd.hasOption(OP_LOG_OPTION); opts.cleanup = cmd.hasOption(CLEANUP_OPTION);
opts.type = FileType.fromOption(cmd.getOptionValue(TYPE_OPTION)); opts.oplogs = cmd.hasOption(OP_LOG_OPTION); opts.cleanup = cmd.hasOption(CLEANUP_OPTION);
static String descr() { StringBuilder str = new StringBuilder(); for (FileType fileType : FileType.values()) { str.append(fileType.option); str.append(" ("); str.append(fileType.descr); str.append("), "); } return str.toString(); } }
private static CmdLineOptions getCmdLineOptions() { CmdLineOptions options = new CmdLineOptions(); options.addOption("c", CLEANUP_OPTION, "clean-up any outstanding transactions"); options.addOption("d", DEBUG_OPTION, "display stack traces"); options.addOption("h", HELP_OPTION, "display this help message"); options.addOption("o", OP_LOG_OPTION, "include operation logs"); options.addOption("t", TYPE_OPTION, true, FileType.descr()); options.addOption("v", VERBOSE_OPTION, "verbose output"); return options; }
static FileType fromOption(String option) { for (FileType fileType : FileType.values()) { if (fileType.option.equals(option)) return fileType; } return FileType.ALL; }
static FileType fromOption(String option) { for (FileType fileType : FileType.values()) { if (fileType.option.equals(option)) return fileType; } return FileType.ALL; }
private static CmdLineOptions getCmdLineOptions() { CmdLineOptions options = new CmdLineOptions(); options.addOption("c", CLEANUP_OPTION, "clean-up any outstanding transactions"); options.addOption("d", DEBUG_OPTION, "display stack traces"); options.addOption("h", HELP_OPTION, "display this help message"); options.addOption("o", OP_LOG_OPTION, "include operation logs"); options.addOption("t", TYPE_OPTION, true, FileType.descr()); options.addOption("v", VERBOSE_OPTION, "verbose output"); return options; }
static FileType fromOption(String option) { for (FileType fileType : FileType.values()) { if (fileType.option.equals(option)) return fileType; } return FileType.ALL; }
static String descr() { StringBuilder str = new StringBuilder(); for (FileType fileType : FileType.values()) { str.append(fileType.option); str.append(" ("); str.append(fileType.descr); str.append("), "); } return str.toString(); } }
private static CmdLineOptions getCmdLineOptions() { CmdLineOptions options = new CmdLineOptions(); options.addOption("c", CLEANUP_OPTION, "clean-up any outstanding transactions"); options.addOption("d", DEBUG_OPTION, "display stack traces"); options.addOption("h", HELP_OPTION, "display this help message"); options.addOption("o", OP_LOG_OPTION, "include operation logs"); options.addOption("t", TYPE_OPTION, true, FileType.descr()); options.addOption("v", VERBOSE_OPTION, "verbose output"); return options; }