Bump args4j version to 2.0.26
New version has features which be useful for Gerrit core and plugins: * new hidden attribute, specifying to hide it in help message * new depends attribute, specifying the dependent option(s) * multiValued attribute was removed Change-Id: Ic7e9f37231cb83940db50fe3b9efe8ad972108cf
This commit is contained in:
@@ -56,7 +56,7 @@ public class Init extends BaseInit {
|
|||||||
@Option(name = "--list-plugins", usage = "List available plugins")
|
@Option(name = "--list-plugins", usage = "List available plugins")
|
||||||
private boolean listPlugins;
|
private boolean listPlugins;
|
||||||
|
|
||||||
@Option(name = "--install-plugin", usage = "Install given plugin without asking", multiValued = true)
|
@Option(name = "--install-plugin", usage = "Install given plugin without asking")
|
||||||
private List<String> installPlugins;
|
private List<String> installPlugins;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import java.util.EnumSet;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PrologShell extends AbstractProgram {
|
public class PrologShell extends AbstractProgram {
|
||||||
@Option(name = "-s", multiValued = true, metaVar = "FILE.pl", usage = "file to load")
|
@Option(name = "-s", metaVar = "FILE.pl", usage = "file to load")
|
||||||
private List<String> fileName = new ArrayList<String>();
|
private List<String> fileName = new ArrayList<String>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class GetCapabilities implements RestReadView<AccountResource> {
|
|||||||
@Option(name = "--format", usage = "(deprecated) output format")
|
@Option(name = "--format", usage = "(deprecated) output format")
|
||||||
private OutputFormat format;
|
private OutputFormat format;
|
||||||
|
|
||||||
@Option(name = "-q", metaVar = "CAP", multiValued = true, usage = "Capability to inspect")
|
@Option(name = "-q", metaVar = "CAP", usage = "Capability to inspect")
|
||||||
void addQuery(String name) {
|
void addQuery(String name) {
|
||||||
if (query == null) {
|
if (query == null) {
|
||||||
query = Sets.newHashSet();
|
query = Sets.newHashSet();
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
public class GetChange implements RestReadView<ChangeResource> {
|
public class GetChange implements RestReadView<ChangeResource> {
|
||||||
private final ChangeJson json;
|
private final ChangeJson json;
|
||||||
|
|
||||||
@Option(name = "-o", multiValued = true, usage = "Output options")
|
@Option(name = "-o", usage = "Output options")
|
||||||
void addOption(ListChangesOption o) {
|
void addOption(ListChangesOption o) {
|
||||||
json.addOption(o);
|
json.addOption(o);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import org.kohsuke.args4j.Option;
|
|||||||
public class GetDetail implements RestReadView<ChangeResource> {
|
public class GetDetail implements RestReadView<ChangeResource> {
|
||||||
private final GetChange delegate;
|
private final GetChange delegate;
|
||||||
|
|
||||||
@Option(name = "-o", multiValued = true, usage = "Output options")
|
@Option(name = "-o", usage = "Output options")
|
||||||
void addOption(ListChangesOption o) {
|
void addOption(ListChangesOption o) {
|
||||||
delegate.addOption(o);
|
delegate.addOption(o);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
|
|||||||
@Option(name = "-m", metaVar = "MATCH", usage = "match group substring")
|
@Option(name = "-m", metaVar = "MATCH", usage = "match group substring")
|
||||||
private String matchSubstring;
|
private String matchSubstring;
|
||||||
|
|
||||||
@Option(name = "-o", multiValued = true, usage = "Output options per group")
|
@Option(name = "-o", usage = "Output options per group")
|
||||||
public void addOption(ListGroupsOption o) {
|
public void addOption(ListGroupsOption o) {
|
||||||
options.add(o);
|
options.add(o);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
|
|||||||
@Option(name = "--format", usage = "(deprecated) output format")
|
@Option(name = "--format", usage = "(deprecated) output format")
|
||||||
private OutputFormat format = OutputFormat.TEXT;
|
private OutputFormat format = OutputFormat.TEXT;
|
||||||
|
|
||||||
@Option(name = "--show-branch", aliases = {"-b"}, multiValued = true,
|
@Option(name = "--show-branch", aliases = {"-b"},
|
||||||
usage = "displays the sha of each project in the specified branch")
|
usage = "displays the sha of each project in the specified branch")
|
||||||
public void addShowBranch(String branch) {
|
public void addShowBranch(String branch) {
|
||||||
showBranch.add(branch);
|
showBranch.add(branch);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class QueryChanges implements RestReadView<TopLevelResource> {
|
|||||||
private boolean reverse;
|
private boolean reverse;
|
||||||
private EnumSet<ListChangesOption> options;
|
private EnumSet<ListChangesOption> options;
|
||||||
|
|
||||||
@Option(name = "--query", aliases = {"-q"}, metaVar = "QUERY", multiValued = true, usage = "Query string")
|
@Option(name = "--query", aliases = {"-q"}, metaVar = "QUERY", usage = "Query string")
|
||||||
private List<String> queries;
|
private List<String> queries;
|
||||||
|
|
||||||
@Option(name = "--limit", aliases = {"-n"}, metaVar = "CNT", usage = "Maximum number of results to return")
|
@Option(name = "--limit", aliases = {"-n"}, metaVar = "CNT", usage = "Maximum number of results to return")
|
||||||
@@ -53,7 +53,7 @@ public class QueryChanges implements RestReadView<TopLevelResource> {
|
|||||||
imp.setLimit(limit);
|
imp.setLimit(limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(name = "-o", multiValued = true, usage = "Output options per change")
|
@Option(name = "-o", usage = "Output options per change")
|
||||||
public void addOption(ListChangesOption o) {
|
public void addOption(ListChangesOption o) {
|
||||||
options.add(o);
|
options.add(o);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ import org.kohsuke.args4j.OptionDef;
|
|||||||
import org.kohsuke.args4j.spi.OneArgumentOptionHandler;
|
import org.kohsuke.args4j.spi.OneArgumentOptionHandler;
|
||||||
import org.kohsuke.args4j.spi.OptionHandler;
|
import org.kohsuke.args4j.spi.OptionHandler;
|
||||||
import org.kohsuke.args4j.spi.Setter;
|
import org.kohsuke.args4j.spi.Setter;
|
||||||
|
import org.kohsuke.args4j.spi.FieldSetter;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.AnnotatedElement;
|
||||||
|
|
||||||
final class ApproveOption implements Option, Setter<Short> {
|
final class ApproveOption implements Option, Setter<Short> {
|
||||||
private final String name;
|
private final String name;
|
||||||
@@ -45,6 +47,16 @@ final class ApproveOption implements Option, Setter<Short> {
|
|||||||
return new String[0];
|
return new String[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] depends() {
|
||||||
|
return new String[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hidden() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends OptionHandler<Short>> handler() {
|
public Class<? extends OptionHandler<Short>> handler() {
|
||||||
return Handler.class;
|
return Handler.class;
|
||||||
@@ -55,11 +67,6 @@ final class ApproveOption implements Option, Setter<Short> {
|
|||||||
return "N";
|
return "N";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean multiValued() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String name() {
|
public String name() {
|
||||||
return name;
|
return name;
|
||||||
@@ -84,6 +91,16 @@ final class ApproveOption implements Option, Setter<Short> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FieldSetter asFieldSetter() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AnnotatedElement asAnnotatedElement() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addValue(final Short val) {
|
public void addValue(final Short val) {
|
||||||
this.value = val;
|
this.value = val;
|
||||||
|
|||||||
@@ -62,12 +62,12 @@ final class Receive extends AbstractGitCommand {
|
|||||||
private final Set<Account.Id> reviewerId = new HashSet<Account.Id>();
|
private final Set<Account.Id> reviewerId = new HashSet<Account.Id>();
|
||||||
private final Set<Account.Id> ccId = new HashSet<Account.Id>();
|
private final Set<Account.Id> ccId = new HashSet<Account.Id>();
|
||||||
|
|
||||||
@Option(name = "--reviewer", aliases = {"--re"}, multiValued = true, metaVar = "EMAIL", usage = "request reviewer for change(s)")
|
@Option(name = "--reviewer", aliases = {"--re"}, metaVar = "EMAIL", usage = "request reviewer for change(s)")
|
||||||
void addReviewer(final Account.Id id) {
|
void addReviewer(final Account.Id id) {
|
||||||
reviewerId.add(id);
|
reviewerId.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Option(name = "--cc", aliases = {}, multiValued = true, metaVar = "EMAIL", usage = "CC user on change(s)")
|
@Option(name = "--cc", aliases = {}, metaVar = "EMAIL", usage = "CC user on change(s)")
|
||||||
void addCC(final Account.Id id) {
|
void addCC(final Account.Id id) {
|
||||||
ccId.add(id);
|
ccId.add(id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,16 +70,16 @@ final class SetAccountCommand extends BaseCommand {
|
|||||||
@Option(name = "--inactive", usage = "set account's state to inactive")
|
@Option(name = "--inactive", usage = "set account's state to inactive")
|
||||||
private boolean inactive;
|
private boolean inactive;
|
||||||
|
|
||||||
@Option(name = "--add-email", multiValued = true, metaVar = "EMAIL", usage = "email addresses to add to the account")
|
@Option(name = "--add-email", metaVar = "EMAIL", usage = "email addresses to add to the account")
|
||||||
private List<String> addEmails = new ArrayList<String>();
|
private List<String> addEmails = new ArrayList<String>();
|
||||||
|
|
||||||
@Option(name = "--delete-email", multiValued = true, metaVar = "EMAIL", usage = "email addresses to delete from the account")
|
@Option(name = "--delete-email", metaVar = "EMAIL", usage = "email addresses to delete from the account")
|
||||||
private List<String> deleteEmails = new ArrayList<String>();
|
private List<String> deleteEmails = new ArrayList<String>();
|
||||||
|
|
||||||
@Option(name = "--add-ssh-key", multiValued = true, metaVar = "-|KEY", usage = "public keys to add to the account")
|
@Option(name = "--add-ssh-key", metaVar = "-|KEY", usage = "public keys to add to the account")
|
||||||
private List<String> addSshKeys = new ArrayList<String>();
|
private List<String> addSshKeys = new ArrayList<String>();
|
||||||
|
|
||||||
@Option(name = "--delete-ssh-key", multiValued = true, metaVar = "-|KEY", usage = "public keys to delete from the account")
|
@Option(name = "--delete-ssh-key", metaVar = "-|KEY", usage = "public keys to delete from the account")
|
||||||
private List<String> deleteSshKeys = new ArrayList<String>();
|
private List<String> deleteSshKeys = new ArrayList<String>();
|
||||||
|
|
||||||
@Option(name = "--http-password", metaVar = "PASSWORD", usage = "password for HTTP authentication for the account")
|
@Option(name = "--http-password", metaVar = "PASSWORD", usage = "password for HTTP authentication for the account")
|
||||||
|
|||||||
@@ -52,10 +52,13 @@ import org.kohsuke.args4j.spi.BooleanOptionHandler;
|
|||||||
import org.kohsuke.args4j.spi.EnumOptionHandler;
|
import org.kohsuke.args4j.spi.EnumOptionHandler;
|
||||||
import org.kohsuke.args4j.spi.OptionHandler;
|
import org.kohsuke.args4j.spi.OptionHandler;
|
||||||
import org.kohsuke.args4j.spi.Setter;
|
import org.kohsuke.args4j.spi.Setter;
|
||||||
|
import org.kohsuke.args4j.spi.FieldSetter;
|
||||||
|
|
||||||
|
|
||||||
import java.io.StringWriter;
|
import java.io.StringWriter;
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.AnnotatedElement;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -380,6 +383,16 @@ public class CmdLineParser {
|
|||||||
return new String[] {"-h"};
|
return new String[] {"-h"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] depends() {
|
||||||
|
return new String[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hidden() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String usage() {
|
public String usage() {
|
||||||
return "display this help text";
|
return "display this help text";
|
||||||
@@ -400,11 +413,6 @@ public class CmdLineParser {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean multiValued() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean required() {
|
public boolean required() {
|
||||||
return false;
|
return false;
|
||||||
@@ -415,6 +423,16 @@ public class CmdLineParser {
|
|||||||
return Option.class;
|
return Option.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FieldSetter asFieldSetter() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AnnotatedElement asAnnotatedElement() {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<Boolean> getType() {
|
public Class<Boolean> getType() {
|
||||||
return Boolean.class;
|
return Boolean.class;
|
||||||
@@ -422,7 +440,7 @@ public class CmdLineParser {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isMultiValued() {
|
public boolean isMultiValued() {
|
||||||
return multiValued();
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
4
lib/BUCK
4
lib/BUCK
@@ -121,8 +121,8 @@ maven_jar(
|
|||||||
|
|
||||||
maven_jar(
|
maven_jar(
|
||||||
name = 'args4j',
|
name = 'args4j',
|
||||||
id = 'args4j:args4j:2.0.16',
|
id = 'args4j:args4j:2.0.26',
|
||||||
sha1 = '9f00fb12820743b9e05c686eba543d64dd43f2b1',
|
sha1 = '01ebb18ebb3b379a74207d5af4ea7c8338ebd78b',
|
||||||
license = 'args4j',
|
license = 'args4j',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user