< prev index next >

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java

Print this page
rev 48074 : 8189102: All tools should support -?, -h and --help
Reviewed-by: kvn, jjg, weijun, alanb, rfield, ksrini

*** 99,115 **** --- 99,117 ---- final boolean hasArg; final Processing<T> processing; final boolean hidden; final String name; final String shortname; + final String shortname2; final boolean terminalOption; public Option(boolean hasArg, Processing<T> processing, boolean hidden, String name, String shortname, + String shortname2, boolean isTerminal) { if (!name.startsWith("--")) { throw new RuntimeException("option name missing --, " + name); }
*** 120,142 **** this.hasArg = hasArg; this.processing = processing; this.hidden = hidden; this.name = name; this.shortname = shortname; this.terminalOption = isTerminal; } public Option(boolean hasArg, Processing<T> processing, String name, String shortname, boolean isTerminal) { ! this(hasArg, processing, false, name, shortname, isTerminal); } public Option(boolean hasArg, Processing<T> processing, String name, String shortname) { ! this(hasArg, processing, false, name, shortname, false); } public Option(boolean hasArg, Processing<T> processing, boolean hidden, String name) { ! this(hasArg, processing, hidden, name, "", false); } public Option(boolean hasArg, Processing<T> processing, String name) { this(hasArg, processing, false, name, "", false); } --- 122,158 ---- this.hasArg = hasArg; this.processing = processing; this.hidden = hidden; this.name = name; this.shortname = shortname; + this.shortname2 = shortname2; this.terminalOption = isTerminal; } + public Option(boolean hasArg, + Processing<T> processing, + boolean hidden, + String name, + String shortname, + boolean isTerminal) + { + this(hasArg, processing, false, name, shortname, "", isTerminal); + } public Option(boolean hasArg, Processing<T> processing, String name, String shortname, boolean isTerminal) { ! this(hasArg, processing, false, name, shortname, "", isTerminal); ! } ! ! public Option(boolean hasArg, Processing<T> processing, String name, String shortname, String shortname2) { ! this(hasArg, processing, false, name, shortname, shortname2, false); } public Option(boolean hasArg, Processing<T> processing, String name, String shortname) { ! this(hasArg, processing, false, name, shortname, "", false); } public Option(boolean hasArg, Processing<T> processing, boolean hidden, String name) { ! this(hasArg, processing, hidden, name, "", "", false); } public Option(boolean hasArg, Processing<T> processing, String name) { this(hasArg, processing, false, name, "", false); }
*** 150,159 **** --- 166,176 ---- } public boolean matches(String opt) { return opt.equals(name) || opt.equals(shortname) || + opt.equals(shortname2) || hasArg && opt.startsWith("--") && opt.startsWith(name + "="); } public boolean ignoreRest() { return false;
< prev index next >