/** * Write DIFF to <var>output-file</var> instead of STDOUT. * * @main.commandLineOptionGroup Output-Generation */ @CommandLineOption public void setOut(File outputFile) { this.outputFile = outputFile; }
/** * @return All names of all options that are members of the group */ private String[] optionNames(CommandLineOptionGroup optionGroup) { List<String> result = new ArrayList<String>(); for (Entry<String, CommandLineOption> e : this.allOptions.entrySet()) { final String optionName = e.getKey(); final CommandLineOption option = e.getValue(); for (Class<?> g : option.group()) { if (g.getAnnotation(CommandLineOptionGroup.class) == optionGroup) { result.add(optionName); break; } } } return result.toArray(new String[result.size()]); }
private Method methodFor(CommandLineOption option) { return AssertionUtil.notNull(this.optionToMethod.get(option), option.toString()); }
String[] names = option.name(); if (names.length == 0) { String n = m.getName(); CommandLineOption.Cardinality c = option.cardinality(); Class<?>[] groupClasses = option.group(); if (groupClasses == null) { throw new AssertionError("Option \"" + option + "\" lacks the \"group\" element");
String[] names = clo.name(); if (names.length == 0) { String n = m.getName(); CommandLineOption.Cardinality c = clo.cardinality(); for (Class<?> optionGroup : clo.group()) { CommandLineOptionGroup clog = optionGroup.getAnnotation(CommandLineOptionGroup.class); if (clog == null) {
/** * @deprecated Use {@code --look-into} instead. */ @Deprecated @CommandLineOption(name = { "zip", "zz", "nested-zip", "gzip" }) public static void noLongerSupported() { System.err.println("Command line option is no longer supported - try \"--help\"."); System.exit(1); } }
/** * @return All names of all options that are members of the <var>optionGroup</var> */ private String[] optionNames(Class<?> optionGroup) { List<String> result = new ArrayList<String>(); for (Entry<String, Method> e : this.allOptions.entrySet()) { final String optionName = e.getKey(); final Method option = e.getValue(); for (Class<?> g : option.getAnnotation(CommandLineOption.class).group()) { if (g == optionGroup) { result.add(optionName); break; } } } return result.toArray(new String[result.size()]); }
/** * When disassembling .class files, include a constant pool dump, constant pool indexes, and hex dumps of all * attributes in the disassembly output. * * @main.commandLineOptionGroup Contents-Processing */ @CommandLineOption public void setDaVerbose() { this.diff.setDisassembleClassFilesVerbose(true); }
/** * Output "<a href="http://en.wikipedia.org/wiki/Diff_utility#Unified_format">unified diff format</a>" with three * lines of context. * * @main.commandLineOptionGroup Output-Generation */ @CommandLineOption(name = { "unified", "u" }, group = DiffModeOptionGroup.class) public void setUnified() { this.diff.setDiffMode(DiffMode.UNIFIED); }
/** * Don't regard C++-style comments ("<code>// ...</code>") as relevant for comparison. * * @main.commandLineOptionGroup Output-Generation */ @CommandLineOption(name = "ignore-c++-style-comments") public void setIgnoreCppStyleComments() { this.diff.setIgnoreCPlusPlusStyleComments(true); }
/** * Suppress all messages except errors. */ @CommandLineOption public void nowarn() { this.levelFilteredPrinter.setNoWarn(); }
/** * Files with different names map iff their names match the <var>path-regex</var> and all capturing groups are * equal. May be given more than once. * * @main.commandLineOptionGroup File-Selection */ @CommandLineOption(name = { "path-equivalence", "pe" }, cardinality = CommandLineOption.Cardinality.ANY) public void addPathEquivalence(Pattern pathRegex) { this.diff.addEquivalentPath(pathRegex); }
/** * Encoding of the files being compared (defaults to the JVM default charset, "${file.encoding}"). * * @main.commandLineOptionGroup Contents-Processing */ @CommandLineOption public void setEncoding(Charset charsetName) { this.diff.setCharset(charsetName); }
/** * Report errors and continue with next file. * * @main.commandLineOptionGroup Output-Generation */ @CommandLineOption public void setKeepGoing() { this.diff.setExceptionHandler(new ExceptionHandler<IOException>() { @Override public void handle(String path, IOException ioe) { Printers.error(path, ioe.getMessage()); } @Override public void handle(String path, RuntimeException re) { Printers.error(path, re.getMessage()); } }); }
/** * Scan directories strictly sequentially. The default is to parallelize the directory scan in multiple threads. * * @main.commandLineOptionGroup Output-Generation */ @CommandLineOption public void setSequential() { this.diff.setSequential(true); }
/** * Suppress "normal" output; print only errors and warnings. * * @main.commandLineOptionGroup Output-Generation */ @CommandLineOption public void setQuiet() { this.levelFilteredPrinter.setQuiet(); }
/** * By default directory members are sorted lexicographically in order to achieve deterministic results. */ @CommandLineOption public void dontSortDirectoryMembers() { this.pack.setDirectoryMemberNameComparator(null); }
/** * Add logging at level FINE on logger 'de.unkrig' to STDERR using the FormatFormatter and SIMPLE format, or the * given arguments which are all optional. * * @param spec <var>level</var>:<var>logger</var>:<var>handler</var>:<var>formatter</var>:<var>format</var> */ @CommandLineOption(cardinality = CommandLineOption.Cardinality.ANY) public static void addLog(String spec) { SimpleLogging.configureLoggers(spec); }
/** * The charset to use when writing the output file. */ @CommandLineOption public void setOutputEncoding(Charset charset) { this.html2Txt.setOutputCharset(charset); } }
/** * Disassemble .class files. * * @main.commandLineOptionGroup Contents-Processing */ @CommandLineOption(name = { "disassemble", "da" }) public void setDisassemble() { this.diff.setDisassembleClassFiles(true); }