Reformat all Java files with google-java-format 1.6

Reformat all files with the exception of:

- lib/asciidoctor/java/AsciiDoctor.java

to avoid requiring the Library-Compliance label.

Change-Id: Iedba3f24ac00e2186e3e0688fabea817ddf43739
This commit is contained in:
David Pursehouse 2018-06-06 09:10:11 +09:00
parent cc21a0a470
commit 54c04f59b9
70 changed files with 694 additions and 886 deletions

View File

@ -48,8 +48,7 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {
@Test @Test
@GerritConfig( @GerritConfig(
name = "section.name", name = "section.name",
values = {"value-1", "value-2"} values = {"value-1", "value-2"})
)
public void testList() { public void testList() {
assertThat(cfg.getStringList("section", null, "name")) assertThat(cfg.getStringList("section", null, "name"))
.asList() .asList()
@ -59,8 +58,7 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {
@Test @Test
@GerritConfig( @GerritConfig(
name = "section.subsection.name", name = "section.subsection.name",
values = {"value-1", "value-2"} values = {"value-1", "value-2"})
)
public void testListWithSubsection() { public void testListWithSubsection() {
assertThat(cfg.getStringList("section", "subsection", "name")) assertThat(cfg.getStringList("section", "subsection", "name"))
.asList() .asList()
@ -71,8 +69,7 @@ public class UseGerritConfigAnnotationTest extends AbstractDaemonTest {
@GerritConfig( @GerritConfig(
name = "section.name", name = "section.name",
value = "value-1", value = "value-1",
values = {"value-2", "value-3"} values = {"value-2", "value-3"})
)
public void valueHasPrecedenceOverValues() { public void valueHasPrecedenceOverValues() {
assertThat(cfg.getStringList("section", null, "name")).asList().containsExactly("value-1"); assertThat(cfg.getStringList("section", null, "name")).asList().containsExactly("value-1");
} }

View File

@ -59,8 +59,7 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest {
@GlobalPluginConfig( @GlobalPluginConfig(
pluginName = "test", pluginName = "test",
name = "section.name", name = "section.name",
values = {"value-1", "value-2"} values = {"value-1", "value-2"})
)
public void testList() { public void testList() {
assertThat(cfg().getStringList("section", null, "name")) assertThat(cfg().getStringList("section", null, "name"))
.asList() .asList()
@ -72,8 +71,7 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest {
@GlobalPluginConfig( @GlobalPluginConfig(
pluginName = "test", pluginName = "test",
name = "section.subsection.name", name = "section.subsection.name",
values = {"value-1", "value-2"} values = {"value-1", "value-2"})
)
public void testListWithSubsection() { public void testListWithSubsection() {
assertThat(cfg().getStringList("section", "subsection", "name")) assertThat(cfg().getStringList("section", "subsection", "name"))
.asList() .asList()
@ -86,8 +84,7 @@ public class UseGlobalPluginConfigAnnotationTest extends AbstractDaemonTest {
pluginName = "test", pluginName = "test",
name = "section.name", name = "section.name",
value = "value-1", value = "value-1",
values = {"value-2", "value-3"} values = {"value-2", "value-3"})
)
public void valueHasPrecedenceOverValues() { public void valueHasPrecedenceOverValues() {
assertThat(cfg().getStringList("section", null, "name")).asList().containsExactly("value-1"); assertThat(cfg().getStringList("section", null, "name")).asList().containsExactly("value-1");
} }

View File

@ -648,8 +648,7 @@ public class AccountIT extends AbstractDaemonTest {
@Test @Test
@GerritConfig( @GerritConfig(
name = "auth.registerEmailPrivateKey", name = "auth.registerEmailPrivateKey",
value = "HsOc6l+2lhS9G7sE/RsnS7Z6GJjdRDX14co=" value = "HsOc6l+2lhS9G7sE/RsnS7Z6GJjdRDX14co=")
)
public void addEmailSendsConfirmationEmail() throws Exception { public void addEmailSendsConfirmationEmail() throws Exception {
String email = "new.email@example.com"; String email = "new.email@example.com";
EmailInput input = newEmailInput(email, false); EmailInput input = newEmailInput(email, false);

View File

@ -63,8 +63,7 @@ public class ServerInfoIT extends AbstractDaemonTest {
// download // download
@GerritConfig( @GerritConfig(
name = "download.archive", name = "download.archive",
values = {"tar", "tbz2", "tgz", "txz"} values = {"tar", "tbz2", "tgz", "txz"})
)
// gerrit // gerrit
@GerritConfig(name = "gerrit.allProjects", value = "Root") @GerritConfig(name = "gerrit.allProjects", value = "Root")

View File

@ -48,8 +48,7 @@ public class ListMailFilterIT extends AbstractMailIT {
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST") @GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
@GerritConfig( @GerritConfig(
name = "receiveemail.filter.patterns", name = "receiveemail.filter.patterns",
values = {".+ser@example\\.com", "a@b\\.com"} values = {".+ser@example\\.com", "a@b\\.com"})
)
public void listFilterWhitelistDoesNotFilterListedUser() throws Exception { public void listFilterWhitelistDoesNotFilterListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail(); ChangeInfo changeInfo = createChangeAndReplyByEmail();
// Check that the comments from the email have been persisted // Check that the comments from the email have been persisted
@ -61,8 +60,7 @@ public class ListMailFilterIT extends AbstractMailIT {
@GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST") @GerritConfig(name = "receiveemail.filter.mode", value = "WHITELIST")
@GerritConfig( @GerritConfig(
name = "receiveemail.filter.patterns", name = "receiveemail.filter.patterns",
values = {".+@gerritcodereview\\.com", "a@b\\.com"} values = {".+@gerritcodereview\\.com", "a@b\\.com"})
)
public void listFilterWhitelistFiltersNotListedUser() throws Exception { public void listFilterWhitelistFiltersNotListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail(); ChangeInfo changeInfo = createChangeAndReplyByEmail();
// Check that the comments from the email have NOT been persisted // Check that the comments from the email have NOT been persisted
@ -74,8 +72,7 @@ public class ListMailFilterIT extends AbstractMailIT {
@GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST") @GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST")
@GerritConfig( @GerritConfig(
name = "receiveemail.filter.patterns", name = "receiveemail.filter.patterns",
values = {".+@gerritcodereview\\.com", "a@b\\.com"} values = {".+@gerritcodereview\\.com", "a@b\\.com"})
)
public void listFilterBlacklistDoesNotFilterNotListedUser() throws Exception { public void listFilterBlacklistDoesNotFilterNotListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail(); ChangeInfo changeInfo = createChangeAndReplyByEmail();
// Check that the comments from the email have been persisted // Check that the comments from the email have been persisted
@ -87,8 +84,7 @@ public class ListMailFilterIT extends AbstractMailIT {
@GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST") @GerritConfig(name = "receiveemail.filter.mode", value = "BLACKLIST")
@GerritConfig( @GerritConfig(
name = "receiveemail.filter.patterns", name = "receiveemail.filter.patterns",
values = {".+@example\\.com", "a@b\\.com"} values = {".+@example\\.com", "a@b\\.com"})
)
public void listFilterBlacklistFiltersListedUser() throws Exception { public void listFilterBlacklistFiltersListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail(); ChangeInfo changeInfo = createChangeAndReplyByEmail();
// Check that the comments from the email have been persisted // Check that the comments from the email have been persisted

View File

@ -57,8 +57,7 @@ public class UploadArchiveIT extends AbstractDaemonTest {
@Test @Test
@GerritConfig( @GerritConfig(
name = "download.archive", name = "download.archive",
values = {"tar", "tbz2", "tgz", "txz"} values = {"tar", "tbz2", "tgz", "txz"})
)
public void zipFormatDisabled() throws Exception { public void zipFormatDisabled() throws Exception {
archiveNotPermitted(); archiveNotPermitted();
} }

View File

@ -164,8 +164,7 @@ public class Daemon extends SiteProgram {
@Option( @Option(
name = "--init", name = "--init",
aliases = {"-i"}, aliases = {"-i"},
usage = "Init site before starting the daemon" usage = "Init site before starting the daemon")
)
private boolean doInit; private boolean doInit;
@Option(name = "--stop-only", usage = "Stop the daemon", hidden = true) @Option(name = "--stop-only", usage = "Stop the daemon", hidden = true)
@ -174,8 +173,7 @@ public class Daemon extends SiteProgram {
@Option( @Option(
name = "--migrate-to-note-db", name = "--migrate-to-note-db",
usage = "Automatically migrate changes to NoteDb", usage = "Automatically migrate changes to NoteDb",
handler = ExplicitBooleanOptionHandler.class handler = ExplicitBooleanOptionHandler.class)
)
private boolean migrateToNoteDb; private boolean migrateToNoteDb;
@Option(name = "--trial", usage = "(With --migrate-to-note-db) " + MigrateToNoteDb.TRIAL_USAGE) @Option(name = "--trial", usage = "(With --migrate-to-note-db) " + MigrateToNoteDb.TRIAL_USAGE)

View File

@ -46,8 +46,7 @@ public class Init extends BaseInit {
@Option( @Option(
name = "--batch", name = "--batch",
aliases = {"-b"}, aliases = {"-b"},
usage = "Batch mode; skip interactive prompting" usage = "Batch mode; skip interactive prompting")
)
private boolean batchMode; private boolean batchMode;
@Option(name = "--delete-caches", usage = "Delete all persistent caches without asking") @Option(name = "--delete-caches", usage = "Delete all persistent caches without asking")
@ -70,8 +69,7 @@ public class Init extends BaseInit {
@Option( @Option(
name = "--secure-store-lib", name = "--secure-store-lib",
usage = "Path to jar providing SecureStore implementation class" usage = "Path to jar providing SecureStore implementation class")
)
private String secureStoreLib; private String secureStoreLib;
@Option(name = "--dev", usage = "Setup site with default options suitable for developers") @Option(name = "--dev", usage = "Setup site with default options suitable for developers")

View File

@ -44,8 +44,7 @@ public class MigrateAccountPatchReviewDb extends SiteProgram {
@Option( @Option(
name = "--chunkSize", name = "--chunkSize",
usage = "chunk size of fetching from source and push to target on each time" usage = "chunk size of fetching from source and push to target on each time")
)
private static long chunkSize = 100000; private static long chunkSize = 100000;
@Override @Override

View File

@ -58,24 +58,21 @@ public class MigrateToNoteDb extends SiteProgram {
name = "--project", name = "--project",
usage = usage =
"Only rebuild these projects, do no other migration; incompatible with --change;" "Only rebuild these projects, do no other migration; incompatible with --change;"
+ " recommended for debugging only" + " recommended for debugging only")
)
private List<String> projects = new ArrayList<>(); private List<String> projects = new ArrayList<>();
@Option( @Option(
name = "--change", name = "--change",
usage = usage =
"Only rebuild these changes, do no other migration; incompatible with --project;" "Only rebuild these changes, do no other migration; incompatible with --project;"
+ " recommended for debugging only" + " recommended for debugging only")
)
private List<Integer> changes = new ArrayList<>(); private List<Integer> changes = new ArrayList<>();
@Option( @Option(
name = "--force", name = "--force",
usage = usage =
"Force rebuilding changes where ReviewDb is still the source of truth, even if they" "Force rebuilding changes where ReviewDb is still the source of truth, even if they"
+ " were previously migrated" + " were previously migrated")
)
private boolean force; private boolean force;
@Option(name = "--trial", usage = TRIAL_USAGE) @Option(name = "--trial", usage = TRIAL_USAGE)
@ -86,15 +83,14 @@ public class MigrateToNoteDb extends SiteProgram {
usage = usage =
"gap in change sequence numbers between last ReviewDb number and first NoteDb number;" "gap in change sequence numbers between last ReviewDb number and first NoteDb number;"
+ " negative indicates using the value of noteDb.changes.initialSequenceGap (default" + " negative indicates using the value of noteDb.changes.initialSequenceGap (default"
+ " 1000)" + " 1000)")
)
private int sequenceGap; private int sequenceGap;
@Option( @Option(
name = "--reindex", name = "--reindex",
usage = "Reindex all changes after migration; defaults to false in trial mode, true otherwise", usage =
handler = ExplicitBooleanOptionHandler.class "Reindex all changes after migration; defaults to false in trial mode, true otherwise",
) handler = ExplicitBooleanOptionHandler.class)
private Boolean reindex; private Boolean reindex;
private Injector dbInjector; private Injector dbInjector;

View File

@ -41,8 +41,7 @@ public class Passwd extends SiteProgram {
metaVar = "SECTION.KEY", metaVar = "SECTION.KEY",
index = 0, index = 0,
required = true, required = true,
usage = "Section and key separated by a dot of the password to set" usage = "Section and key separated by a dot of the password to set")
)
private String sectionAndKey; private String sectionAndKey;
@Argument(metaVar = "PASSWORD", index = 1, required = false, usage = "Password to set") @Argument(metaVar = "PASSWORD", index = 1, required = false, usage = "Password to set")

View File

@ -36,8 +36,7 @@ public class ProtoGen extends AbstractProgram {
aliases = {"-o"}, aliases = {"-o"},
required = true, required = true,
metaVar = "FILE", metaVar = "FILE",
usage = "File to write .proto into" usage = "File to write .proto into")
)
private File file; private File file;
@Override @Override

View File

@ -69,8 +69,7 @@ public class ProtobufImport extends SiteProgram {
aliases = {"-f"}, aliases = {"-f"},
required = true, required = true,
metaVar = "FILE", metaVar = "FILE",
usage = "File to import from" usage = "File to import from")
)
private File file; private File file;
private final LifecycleManager manager = new LifecycleManager(); private final LifecycleManager manager = new LifecycleManager();

View File

@ -58,8 +58,7 @@ public class Reindex extends SiteProgram {
@Option( @Option(
name = "--changes-schema-version", name = "--changes-schema-version",
usage = "Schema version to reindex, for changes; default is most recent version" usage = "Schema version to reindex, for changes; default is most recent version")
)
private Integer changesVersion; private Integer changesVersion;
@Option(name = "--verbose", usage = "Output debug information for each change") @Option(name = "--verbose", usage = "Output debug information for each change")

View File

@ -47,8 +47,7 @@ public class Rulec extends SiteProgram {
index = 0, index = 0,
multiValued = true, multiValued = true,
metaVar = "PROJECT", metaVar = "PROJECT",
usage = "project to compile rules for" usage = "project to compile rules for")
)
private List<String> projectNames = new ArrayList<>(); private List<String> projectNames = new ArrayList<>();
private Injector dbInjector; private Injector dbInjector;

View File

@ -59,8 +59,7 @@ public class SwitchSecureStore extends SiteProgram {
@Option( @Option(
name = "--new-secure-store-lib", name = "--new-secure-store-lib",
usage = "Path to new SecureStore implementation", usage = "Path to new SecureStore implementation",
required = true required = true)
)
private String newSecureStoreLib; private String newSecureStoreLib;
@Override @Override

View File

@ -66,8 +66,7 @@ public abstract class SiteProgram extends AbstractProgram {
@Option( @Option(
name = "--site-path", name = "--site-path",
aliases = {"-d"}, aliases = {"-d"},
usage = "Local directory containing site data" usage = "Local directory containing site data")
)
private void setSitePath(String path) { private void setSitePath(String path) {
sitePath = Paths.get(path); sitePath = Paths.get(path);
} }

View File

@ -42,8 +42,7 @@ class ListMetrics implements RestReadView<ConfigResource> {
name = "--prefix", name = "--prefix",
aliases = {"-p"}, aliases = {"-p"},
metaVar = "PREFIX", metaVar = "PREFIX",
usage = "match metric by exact match or prefix" usage = "match metric by exact match or prefix")
)
List<String> query = new ArrayList<>(); List<String> query = new ArrayList<>();
@Inject @Inject

View File

@ -37,8 +37,7 @@ public class ListAccess implements RestReadView<TopLevelResource> {
name = "--project", name = "--project",
aliases = {"-p"}, aliases = {"-p"},
metaVar = "PROJECT", metaVar = "PROJECT",
usage = "projects for which the access rights should be returned" usage = "projects for which the access rights should be returned")
)
private List<String> projects = new ArrayList<>(); private List<String> projects = new ArrayList<>();
private final GetAccess getAccess; private final GetAccess getAccess;

View File

@ -33,8 +33,7 @@ public class GetAvatar implements RestReadView<AccountResource> {
@Option( @Option(
name = "--size", name = "--size",
aliases = {"-s"}, aliases = {"-s"},
usage = "recommended size in pixels, height and width" usage = "recommended size in pixels, height and width")
)
public void setSize(int s) { public void setSize(int s) {
size = s; size = s;
} }

View File

@ -69,8 +69,7 @@ public class QueryAccounts implements RestReadView<TopLevelResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of users to return" usage = "maximum number of users to return")
)
public void setLimit(int n) { public void setLimit(int n) {
queryProcessor.setUserProvidedLimit(n); queryProcessor.setUserProvidedLimit(n);
@ -97,8 +96,7 @@ public class QueryAccounts implements RestReadView<TopLevelResource> {
name = "--query", name = "--query",
aliases = {"-q"}, aliases = {"-q"},
metaVar = "QUERY", metaVar = "QUERY",
usage = "match users" usage = "match users")
)
public void setQuery(String query) { public void setQuery(String query) {
this.query = query; this.query = query;
} }
@ -107,8 +105,7 @@ public class QueryAccounts implements RestReadView<TopLevelResource> {
name = "--start", name = "--start",
aliases = {"-S"}, aliases = {"-S"},
metaVar = "CNT", metaVar = "CNT",
usage = "Number of accounts to skip" usage = "Number of accounts to skip")
)
public void setStart(int start) { public void setStart(int start) {
this.start = start; this.start = start;
} }

View File

@ -382,8 +382,7 @@ public class ChangeEdits
@Option( @Option(
name = "--base", name = "--base",
aliases = {"-b"}, aliases = {"-b"},
usage = "whether to load the content on the base revision instead of the change edit" usage = "whether to load the content on the base revision instead of the change edit")
)
private boolean base; private boolean base;
@Inject @Inject
@ -484,8 +483,7 @@ public class ChangeEdits
@Option( @Option(
name = "--base", name = "--base",
aliases = {"-b"}, aliases = {"-b"},
usage = "whether to load the message on the base revision instead of the change edit" usage = "whether to load the message on the base revision instead of the change edit")
)
private boolean base; private boolean base;
@Inject @Inject

View File

@ -63,8 +63,7 @@ public class GetBlame implements RestReadView<FileResource> {
aliases = {"-b"}, aliases = {"-b"},
usage = usage =
"whether to load the blame of the base revision (the direct" "whether to load the blame of the base revision (the direct"
+ " parent of the change) instead of the change" + " parent of the change) instead of the change")
)
private boolean base; private boolean base;
@Inject @Inject

View File

@ -56,8 +56,7 @@ public class GetPureRevert implements RestReadView<ChangeResource> {
@Option( @Option(
name = "--claimed-original", name = "--claimed-original",
aliases = {"-o"}, aliases = {"-o"},
usage = "SHA1 (40 digit hex) of the original commit" usage = "SHA1 (40 digit hex) of the original commit")
)
@Nullable @Nullable
private String claimedOriginal; private String claimedOriginal;

View File

@ -57,8 +57,7 @@ public class Mergeable implements RestReadView<RevisionResource> {
@Option( @Option(
name = "--other-branches", name = "--other-branches",
aliases = {"-o"}, aliases = {"-o"},
usage = "test mergeability for other branches too" usage = "test mergeability for other branches too")
)
private boolean otherBranches; private boolean otherBranches;
private final GitRepositoryManager gitManager; private final GitRepositoryManager gitManager;

View File

@ -45,8 +45,7 @@ public class SuggestChangeReviewers extends SuggestReviewers
@Option( @Option(
name = "--exclude-groups", name = "--exclude-groups",
aliases = {"-e"}, aliases = {"-e"},
usage = "exclude groups from query" usage = "exclude groups from query")
)
boolean excludeGroups; boolean excludeGroups;
private final PermissionBackend permissionBackend; private final PermissionBackend permissionBackend;

View File

@ -42,8 +42,7 @@ public class SuggestReviewers {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of reviewers to list" usage = "maximum number of reviewers to list")
)
public void setLimit(int l) { public void setLimit(int l) {
this.limit = l <= 0 ? maxSuggestedReviewers : Math.min(l, maxSuggestedReviewers); this.limit = l <= 0 ? maxSuggestedReviewers : Math.min(l, maxSuggestedReviewers);
} }
@ -52,8 +51,7 @@ public class SuggestReviewers {
name = "--query", name = "--query",
aliases = {"-q"}, aliases = {"-q"},
metaVar = "QUERY", metaVar = "QUERY",
usage = "match reviewers query" usage = "match reviewers query")
)
public void setQuery(String q) { public void setQuery(String q) {
this.query = q; this.query = q;
} }

View File

@ -1175,8 +1175,7 @@ class ReceiveCommits {
name = "--draft", name = "--draft",
usage = usage =
"Will be removed. Before that, this option will be mapped to '--private'" "Will be removed. Before that, this option will be mapped to '--private'"
+ "for new changes and '--edit' for existing changes" + "for new changes and '--edit' for existing changes")
)
boolean draft; boolean draft;
boolean publish; boolean publish;
@ -1190,8 +1189,7 @@ class ReceiveCommits {
@Option( @Option(
name = "--wip", name = "--wip",
aliases = {"-work-in-progress"}, aliases = {"-work-in-progress"},
usage = "mark change as work in progress" usage = "mark change as work in progress")
)
boolean workInProgress; boolean workInProgress;
@Option(name = "--ready", usage = "mark change as ready") @Option(name = "--ready", usage = "mark change as ready")
@ -1200,8 +1198,7 @@ class ReceiveCommits {
@Option( @Option(
name = "--edit", name = "--edit",
aliases = {"-e"}, aliases = {"-e"},
usage = "upload as change edit" usage = "upload as change edit")
)
boolean edit; boolean edit;
@Option(name = "--submit", usage = "immediately submit the change") @Option(name = "--submit", usage = "immediately submit the change")
@ -1216,8 +1213,7 @@ class ReceiveCommits {
@Option( @Option(
name = "--no-publish-comments", name = "--no-publish-comments",
aliases = {"--np"}, aliases = {"--np"},
usage = "do not publish draft comments" usage = "do not publish draft comments")
)
private boolean noPublishComments; private boolean noPublishComments;
@Option( @Option(
@ -1225,8 +1221,7 @@ class ReceiveCommits {
usage = usage =
"Notify handling that defines to whom email notifications " "Notify handling that defines to whom email notifications "
+ "should be sent. Allowed values are NONE, OWNER, " + "should be sent. Allowed values are NONE, OWNER, "
+ "OWNER_REVIEWERS, ALL. If not set, the default is ALL." + "OWNER_REVIEWERS, ALL. If not set, the default is ALL.")
)
private NotifyHandling notify; private NotifyHandling notify;
@Option(name = "--notify-to", metaVar = "USER", usage = "user that should be notified") @Option(name = "--notify-to", metaVar = "USER", usage = "user that should be notified")
@ -1242,8 +1237,7 @@ class ReceiveCommits {
name = "--reviewer", name = "--reviewer",
aliases = {"-r"}, aliases = {"-r"},
metaVar = "EMAIL", metaVar = "EMAIL",
usage = "add reviewer to changes" usage = "add reviewer to changes")
)
void reviewer(Account.Id id) { void reviewer(Account.Id id) {
reviewer.add(id); reviewer.add(id);
} }
@ -1257,8 +1251,7 @@ class ReceiveCommits {
name = "--label", name = "--label",
aliases = {"-l"}, aliases = {"-l"},
metaVar = "LABEL+VALUE", metaVar = "LABEL+VALUE",
usage = "label(s) to assign (defaults to +1 if no value provided" usage = "label(s) to assign (defaults to +1 if no value provided")
)
void addLabel(String token) throws CmdLineException { void addLabel(String token) throws CmdLineException {
LabelVote v = LabelVote.parse(token); LabelVote v = LabelVote.parse(token);
try { try {
@ -1274,8 +1267,7 @@ class ReceiveCommits {
name = "--message", name = "--message",
aliases = {"-m"}, aliases = {"-m"},
metaVar = "MESSAGE", metaVar = "MESSAGE",
usage = "Comment message to apply to the review" usage = "Comment message to apply to the review")
)
void addMessage(String token) { void addMessage(String token) {
// Many characters have special meaning in the context of a git ref. // Many characters have special meaning in the context of a git ref.
// //
@ -1296,8 +1288,7 @@ class ReceiveCommits {
name = "--hashtag", name = "--hashtag",
aliases = {"-t"}, aliases = {"-t"},
metaVar = "HASHTAG", metaVar = "HASHTAG",
usage = "add hashtag to changes" usage = "add hashtag to changes")
)
void addHashtag(String token) throws CmdLineException { void addHashtag(String token) throws CmdLineException {
if (!notesMigration.readChanges()) { if (!notesMigration.readChanges()) {
throw clp.reject("cannot add hashtags; noteDb is disabled"); throw clp.reject("cannot add hashtags; noteDb is disabled");

View File

@ -92,16 +92,14 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--project", name = "--project",
aliases = {"-p"}, aliases = {"-p"},
usage = "projects for which the groups should be listed" usage = "projects for which the groups should be listed")
)
public void addProject(ProjectControl project) { public void addProject(ProjectControl project) {
projects.add(project); projects.add(project);
} }
@Option( @Option(
name = "--visible-to-all", name = "--visible-to-all",
usage = "to list only groups that are visible to all registered users" usage = "to list only groups that are visible to all registered users")
)
public void setVisibleToAll(boolean visibleToAll) { public void setVisibleToAll(boolean visibleToAll) {
this.visibleToAll = visibleToAll; this.visibleToAll = visibleToAll;
} }
@ -109,8 +107,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--user", name = "--user",
aliases = {"-u"}, aliases = {"-u"},
usage = "user for which the groups should be listed" usage = "user for which the groups should be listed")
)
public void setUser(Account.Id user) { public void setUser(Account.Id user) {
this.user = user; this.user = user;
} }
@ -119,8 +116,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--owned", name = "--owned",
usage = usage =
"to list only groups that are owned by the" "to list only groups that are owned by the"
+ " specified user or by the calling user if no user was specifed" + " specified user or by the calling user if no user was specifed")
)
public void setOwned(boolean owned) { public void setOwned(boolean owned) {
this.owned = owned; this.owned = owned;
} }
@ -135,8 +131,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--query", name = "--query",
aliases = {"-q"}, aliases = {"-q"},
usage = "group to inspect (deprecated: use --group/-g instead)" usage = "group to inspect (deprecated: use --group/-g instead)")
)
void addGroup_Deprecated(AccountGroup.UUID uuid) { void addGroup_Deprecated(AccountGroup.UUID uuid) {
addGroup(uuid); addGroup(uuid);
} }
@ -144,8 +139,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--group", name = "--group",
aliases = {"-g"}, aliases = {"-g"},
usage = "group to inspect" usage = "group to inspect")
)
public void addGroup(AccountGroup.UUID uuid) { public void addGroup(AccountGroup.UUID uuid) {
groupsToInspect.add(uuid); groupsToInspect.add(uuid);
} }
@ -154,8 +148,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of groups to list" usage = "maximum number of groups to list")
)
public void setLimit(int limit) { public void setLimit(int limit) {
this.limit = limit; this.limit = limit;
} }
@ -164,8 +157,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--start", name = "--start",
aliases = {"-S"}, aliases = {"-S"},
metaVar = "CNT", metaVar = "CNT",
usage = "number of groups to skip" usage = "number of groups to skip")
)
public void setStart(int start) { public void setStart(int start) {
this.start = start; this.start = start;
} }
@ -174,8 +166,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--match", name = "--match",
aliases = {"-m"}, aliases = {"-m"},
metaVar = "MATCH", metaVar = "MATCH",
usage = "match group substring" usage = "match group substring")
)
public void setMatchSubstring(String matchSubstring) { public void setMatchSubstring(String matchSubstring) {
this.matchSubstring = matchSubstring; this.matchSubstring = matchSubstring;
} }
@ -184,8 +175,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--regex", name = "--regex",
aliases = {"-r"}, aliases = {"-r"},
metaVar = "REGEX", metaVar = "REGEX",
usage = "match group regex" usage = "match group regex")
)
public void setMatchRegex(String matchRegex) { public void setMatchRegex(String matchRegex) {
this.matchRegex = matchRegex; this.matchRegex = matchRegex;
} }
@ -193,8 +183,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--suggest", name = "--suggest",
aliases = {"-s"}, aliases = {"-s"},
usage = "to get a suggestion of groups" usage = "to get a suggestion of groups")
)
public void setSuggest(String suggest) { public void setSuggest(String suggest) {
this.suggest = suggest; this.suggest = suggest;
} }

View File

@ -52,8 +52,7 @@ public class QueryGroups implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--query2", name = "--query2",
aliases = {"-q2"}, aliases = {"-q2"},
usage = "group query" usage = "group query")
)
public void setQuery(String query) { public void setQuery(String query) {
this.query = query; this.query = query;
} }
@ -62,8 +61,7 @@ public class QueryGroups implements RestReadView<TopLevelResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of groups to list" usage = "maximum number of groups to list")
)
public void setLimit(int limit) { public void setLimit(int limit) {
this.limit = limit; this.limit = limit;
} }
@ -72,8 +70,7 @@ public class QueryGroups implements RestReadView<TopLevelResource> {
name = "--start", name = "--start",
aliases = {"-S"}, aliases = {"-S"},
metaVar = "CNT", metaVar = "CNT",
usage = "number of groups to skip" usage = "number of groups to skip")
)
public void setStart(int start) { public void setStart(int start) {
this.start = start; this.start = start;
} }

View File

@ -49,8 +49,7 @@ public class ListPlugins implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--all", name = "--all",
aliases = {"-a"}, aliases = {"-a"},
usage = "List all plugins, including disabled plugins" usage = "List all plugins, including disabled plugins")
)
public void setAll(boolean all) { public void setAll(boolean all) {
this.all = all; this.all = all;
} }
@ -59,8 +58,7 @@ public class ListPlugins implements RestReadView<TopLevelResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of plugins to list" usage = "maximum number of plugins to list")
)
public void setLimit(int limit) { public void setLimit(int limit) {
this.limit = limit; this.limit = limit;
} }
@ -69,8 +67,7 @@ public class ListPlugins implements RestReadView<TopLevelResource> {
name = "--start", name = "--start",
aliases = {"-S"}, aliases = {"-S"},
metaVar = "CNT", metaVar = "CNT",
usage = "number of plugins to skip" usage = "number of plugins to skip")
)
public void setStart(int start) { public void setStart(int start) {
this.start = start; this.start = start;
} }
@ -79,8 +76,7 @@ public class ListPlugins implements RestReadView<TopLevelResource> {
name = "--prefix", name = "--prefix",
aliases = {"-p"}, aliases = {"-p"},
metaVar = "PREFIX", metaVar = "PREFIX",
usage = "match plugin prefix" usage = "match plugin prefix")
)
public void setMatchPrefix(String matchPrefix) { public void setMatchPrefix(String matchPrefix) {
this.matchPrefix = matchPrefix; this.matchPrefix = matchPrefix;
} }
@ -89,8 +85,7 @@ public class ListPlugins implements RestReadView<TopLevelResource> {
name = "--match", name = "--match",
aliases = {"-m"}, aliases = {"-m"},
metaVar = "MATCH", metaVar = "MATCH",
usage = "match plugin substring" usage = "match plugin substring")
)
public void setMatchSubstring(String matchSubstring) { public void setMatchSubstring(String matchSubstring) {
this.matchSubstring = matchSubstring; this.matchSubstring = matchSubstring;
} }

View File

@ -48,8 +48,7 @@ public class CheckMergeability implements RestReadView<BranchResource> {
"the source reference to merge, which could be any git object " "the source reference to merge, which could be any git object "
+ "references expression, refer to " + "references expression, refer to "
+ "org.eclipse.jgit.lib.Repository#resolve(String)", + "org.eclipse.jgit.lib.Repository#resolve(String)",
required = true required = true)
)
public void setSource(String source) { public void setSource(String source) {
this.source = source; this.source = source;
} }
@ -57,8 +56,7 @@ public class CheckMergeability implements RestReadView<BranchResource> {
@Option( @Option(
name = "--strategy", name = "--strategy",
metaVar = "STRATEGY", metaVar = "STRATEGY",
usage = "name of the merge strategy, refer to org.eclipse.jgit.merge.MergeStrategy" usage = "name of the merge strategy, refer to org.eclipse.jgit.merge.MergeStrategy")
)
public void setStrategy(String strategy) { public void setStrategy(String strategy) {
this.strategy = strategy; this.strategy = strategy;
} }

View File

@ -45,8 +45,7 @@ public class GetReflog implements RestReadView<BranchResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of reflog entries to list" usage = "maximum number of reflog entries to list")
)
public GetReflog setLimit(int limit) { public GetReflog setLimit(int limit) {
this.limit = limit; this.limit = limit;
return this; return this;
@ -58,8 +57,7 @@ public class GetReflog implements RestReadView<BranchResource> {
usage = usage =
"timestamp from which the reflog entries should be listed (UTC, format: " "timestamp from which the reflog entries should be listed (UTC, format: "
+ TimestampHandler.TIMESTAMP_FORMAT + TimestampHandler.TIMESTAMP_FORMAT
+ ")" + ")")
)
public GetReflog setFrom(Timestamp from) { public GetReflog setFrom(Timestamp from) {
this.from = from; this.from = from;
return this; return this;
@ -71,8 +69,7 @@ public class GetReflog implements RestReadView<BranchResource> {
usage = usage =
"timestamp until which the reflog entries should be listed (UTC, format: " "timestamp until which the reflog entries should be listed (UTC, format: "
+ TimestampHandler.TIMESTAMP_FORMAT + TimestampHandler.TIMESTAMP_FORMAT
+ ")" + ")")
)
public GetReflog setTo(Timestamp to) { public GetReflog setTo(Timestamp to) {
this.to = to; this.to = to;
return this; return this;

View File

@ -63,8 +63,7 @@ public class ListBranches implements RestReadView<ProjectResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of branches to list" usage = "maximum number of branches to list")
)
public void setLimit(int limit) { public void setLimit(int limit) {
this.limit = limit; this.limit = limit;
} }
@ -73,8 +72,7 @@ public class ListBranches implements RestReadView<ProjectResource> {
name = "--start", name = "--start",
aliases = {"-S", "-s"}, aliases = {"-S", "-s"},
metaVar = "CNT", metaVar = "CNT",
usage = "number of branches to skip" usage = "number of branches to skip")
)
public void setStart(int start) { public void setStart(int start) {
this.start = start; this.start = start;
} }
@ -83,8 +81,7 @@ public class ListBranches implements RestReadView<ProjectResource> {
name = "--match", name = "--match",
aliases = {"-m"}, aliases = {"-m"},
metaVar = "MATCH", metaVar = "MATCH",
usage = "match branches substring" usage = "match branches substring")
)
public void setMatchSubstring(String matchSubstring) { public void setMatchSubstring(String matchSubstring) {
this.matchSubstring = matchSubstring; this.matchSubstring = matchSubstring;
} }
@ -93,8 +90,7 @@ public class ListBranches implements RestReadView<ProjectResource> {
name = "--regex", name = "--regex",
aliases = {"-r"}, aliases = {"-r"},
metaVar = "REGEX", metaVar = "REGEX",
usage = "match branches regex" usage = "match branches regex")
)
public void setMatchRegex(String matchRegex) { public void setMatchRegex(String matchRegex) {
this.matchRegex = matchRegex; this.matchRegex = matchRegex;
} }

View File

@ -154,8 +154,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--show-branch", name = "--show-branch",
aliases = {"-b"}, 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);
} }
@ -165,8 +164,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
aliases = {"-t"}, aliases = {"-t"},
usage = usage =
"displays project inheritance in a tree-like format\n" "displays project inheritance in a tree-like format\n"
+ "this option does not work together with the show-branch option" + "this option does not work together with the show-branch option")
)
public void setShowTree(boolean showTree) { public void setShowTree(boolean showTree) {
this.showTree = showTree; this.showTree = showTree;
} }
@ -179,8 +177,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--description", name = "--description",
aliases = {"-d"}, aliases = {"-d"},
usage = "include description of project in list" usage = "include description of project in list")
)
public void setShowDescription(boolean showDescription) { public void setShowDescription(boolean showDescription) {
this.showDescription = showDescription; this.showDescription = showDescription;
} }
@ -194,8 +191,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of projects to list" usage = "maximum number of projects to list")
)
public void setLimit(int limit) { public void setLimit(int limit) {
this.limit = limit; this.limit = limit;
} }
@ -204,8 +200,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--start", name = "--start",
aliases = {"-S"}, aliases = {"-S"},
metaVar = "CNT", metaVar = "CNT",
usage = "number of projects to skip" usage = "number of projects to skip")
)
public void setStart(int start) { public void setStart(int start) {
this.start = start; this.start = start;
} }
@ -214,8 +209,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--prefix", name = "--prefix",
aliases = {"-p"}, aliases = {"-p"},
metaVar = "PREFIX", metaVar = "PREFIX",
usage = "match project prefix" usage = "match project prefix")
)
public void setMatchPrefix(String matchPrefix) { public void setMatchPrefix(String matchPrefix) {
this.matchPrefix = matchPrefix; this.matchPrefix = matchPrefix;
} }
@ -224,8 +218,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--match", name = "--match",
aliases = {"-m"}, aliases = {"-m"},
metaVar = "MATCH", metaVar = "MATCH",
usage = "match project substring" usage = "match project substring")
)
public void setMatchSubstring(String matchSubstring) { public void setMatchSubstring(String matchSubstring) {
this.matchSubstring = matchSubstring; this.matchSubstring = matchSubstring;
} }
@ -238,8 +231,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
@Option( @Option(
name = "--has-acl-for", name = "--has-acl-for",
metaVar = "GROUP", metaVar = "GROUP",
usage = "displays only projects on which access rights for this group are directly assigned" usage = "displays only projects on which access rights for this group are directly assigned")
)
public void setGroupUuid(AccountGroup.UUID groupUuid) { public void setGroupUuid(AccountGroup.UUID groupUuid) {
this.groupUuid = groupUuid; this.groupUuid = groupUuid;
} }

View File

@ -60,8 +60,7 @@ public class ListTags implements RestReadView<ProjectResource> {
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "maximum number of tags to list" usage = "maximum number of tags to list")
)
public void setLimit(int limit) { public void setLimit(int limit) {
this.limit = limit; this.limit = limit;
} }
@ -70,8 +69,7 @@ public class ListTags implements RestReadView<ProjectResource> {
name = "--start", name = "--start",
aliases = {"-S", "-s"}, aliases = {"-S", "-s"},
metaVar = "CNT", metaVar = "CNT",
usage = "number of tags to skip" usage = "number of tags to skip")
)
public void setStart(int start) { public void setStart(int start) {
this.start = start; this.start = start;
} }
@ -80,8 +78,7 @@ public class ListTags implements RestReadView<ProjectResource> {
name = "--match", name = "--match",
aliases = {"-m"}, aliases = {"-m"},
metaVar = "MATCH", metaVar = "MATCH",
usage = "match tags substring" usage = "match tags substring")
)
public void setMatchSubstring(String matchSubstring) { public void setMatchSubstring(String matchSubstring) {
this.matchSubstring = matchSubstring; this.matchSubstring = matchSubstring;
} }
@ -90,8 +87,7 @@ public class ListTags implements RestReadView<ProjectResource> {
name = "--regex", name = "--regex",
aliases = {"-r"}, aliases = {"-r"},
metaVar = "REGEX", metaVar = "REGEX",
usage = "match tags regex" usage = "match tags regex")
)
public void setMatchRegex(String matchRegex) { public void setMatchRegex(String matchRegex) {
this.matchRegex = matchRegex; this.matchRegex = matchRegex;
} }

View File

@ -45,16 +45,14 @@ public class QueryChanges implements RestReadView<TopLevelResource> {
name = "--query", name = "--query",
aliases = {"-q"}, aliases = {"-q"},
metaVar = "QUERY", metaVar = "QUERY",
usage = "Query string" usage = "Query string")
)
private List<String> queries; private List<String> queries;
@Option( @Option(
name = "--limit", name = "--limit",
aliases = {"-n"}, aliases = {"-n"},
metaVar = "CNT", metaVar = "CNT",
usage = "Maximum number of results to return" usage = "Maximum number of results to return")
)
public void setLimit(int limit) { public void setLimit(int limit) {
imp.setUserProvidedLimit(limit); imp.setUserProvidedLimit(limit);
} }
@ -73,8 +71,7 @@ public class QueryChanges implements RestReadView<TopLevelResource> {
name = "--start", name = "--start",
aliases = {"-S"}, aliases = {"-S"},
metaVar = "CNT", metaVar = "CNT",
usage = "Number of changes to skip" usage = "Number of changes to skip")
)
public void setStart(int start) { public void setStart(int start) {
imp.setStart(start); imp.setStart(start);
} }

View File

@ -46,8 +46,7 @@ import org.slf4j.LoggerFactory;
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER) @RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
@CommandMetaData( @CommandMetaData(
name = "set-project-parent", name = "set-project-parent",
description = "Change the project permissions are inherited from" description = "Change the project permissions are inherited from")
)
final class AdminSetParent extends SshCommand { final class AdminSetParent extends SshCommand {
private static final Logger log = LoggerFactory.getLogger(AdminSetParent.class); private static final Logger log = LoggerFactory.getLogger(AdminSetParent.class);
@ -55,22 +54,19 @@ final class AdminSetParent extends SshCommand {
name = "--parent", name = "--parent",
aliases = {"-p"}, aliases = {"-p"},
metaVar = "NAME", metaVar = "NAME",
usage = "new parent project" usage = "new parent project")
)
private ProjectControl newParent; private ProjectControl newParent;
@Option( @Option(
name = "--children-of", name = "--children-of",
metaVar = "NAME", metaVar = "NAME",
usage = "parent project for which the child projects should be reparented" usage = "parent project for which the child projects should be reparented")
)
private ProjectControl oldParent; private ProjectControl oldParent;
@Option( @Option(
name = "--exclude", name = "--exclude",
metaVar = "NAME", metaVar = "NAME",
usage = "child project of old parent project which should not be reparented" usage = "child project of old parent project which should not be reparented")
)
private List<ProjectControl> excludedChildren = new ArrayList<>(); private List<ProjectControl> excludedChildren = new ArrayList<>();
@Argument( @Argument(
@ -78,8 +74,7 @@ final class AdminSetParent extends SshCommand {
required = false, required = false,
multiValued = true, multiValued = true,
metaVar = "NAME", metaVar = "NAME",
usage = "projects to modify" usage = "projects to modify")
)
private List<ProjectControl> children = new ArrayList<>(); private List<ProjectControl> children = new ArrayList<>();
@Inject private ProjectCache projectCache; @Inject private ProjectCache projectCache;

View File

@ -29,8 +29,7 @@ import org.kohsuke.args4j.Argument;
@CommandMetaData( @CommandMetaData(
name = "apropos", name = "apropos",
description = "Search in Gerrit documentation", description = "Search in Gerrit documentation",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
final class AproposCommand extends SshCommand { final class AproposCommand extends SshCommand {
@Inject private QueryDocumentationExecutor searcher; @Inject private QueryDocumentationExecutor searcher;
@Inject @CanonicalWebUrl String url; @Inject @CanonicalWebUrl String url;

View File

@ -34,23 +34,20 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "ban-commit", name = "ban-commit",
description = "Ban a commit from a project's repository", description = "Ban a commit from a project's repository",
runsAt = MASTER runsAt = MASTER)
)
public class BanCommitCommand extends SshCommand { public class BanCommitCommand extends SshCommand {
@Option( @Option(
name = "--reason", name = "--reason",
aliases = {"-r"}, aliases = {"-r"},
metaVar = "REASON", metaVar = "REASON",
usage = "reason for banning the commit" usage = "reason for banning the commit")
)
private String reason; private String reason;
@Argument( @Argument(
index = 0, index = 0,
required = true, required = true,
metaVar = "PROJECT", metaVar = "PROJECT",
usage = "name of the project for which the commit should be banned" usage = "name of the project for which the commit should be banned")
)
private ProjectControl projectControl; private ProjectControl projectControl;
@Argument( @Argument(
@ -58,8 +55,7 @@ public class BanCommitCommand extends SshCommand {
required = true, required = true,
multiValued = true, multiValued = true,
metaVar = "COMMIT", metaVar = "COMMIT",
usage = "commit(s) that should be banned" usage = "commit(s) that should be banned")
)
private List<ObjectId> commitsToBan = new ArrayList<>(); private List<ObjectId> commitsToBan = new ArrayList<>();
@Inject private BanCommit banCommit; @Inject private BanCommit banCommit;

View File

@ -44,15 +44,13 @@ abstract class BaseTestPrologCommand extends SshCommand {
@Option( @Option(
name = "-s", name = "-s",
usage = usage =
"Read prolog script from stdin instead of reading rules.pl from the refs/meta/config branch" "Read prolog script from stdin instead of reading rules.pl from the refs/meta/config branch")
)
protected boolean useStdin; protected boolean useStdin;
@Option( @Option(
name = "--no-filters", name = "--no-filters",
aliases = {"-n"}, aliases = {"-n"},
usage = "Don't run the submit_filter/2 from the parent projects" usage = "Don't run the submit_filter/2 from the parent projects")
)
void setNoFilters(boolean no) { void setNoFilters(boolean no) {
input.filters = no ? Filters.SKIP : Filters.RUN; input.filters = no ? Filters.SKIP : Filters.RUN;
} }

View File

@ -42,8 +42,7 @@ import org.slf4j.LoggerFactory;
@CommandMetaData( @CommandMetaData(
name = "close-connection", name = "close-connection",
description = "Close the specified SSH connection", description = "Close the specified SSH connection",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
final class CloseConnection extends SshCommand { final class CloseConnection extends SshCommand {
private static final Logger log = LoggerFactory.getLogger(CloseConnection.class); private static final Logger log = LoggerFactory.getLogger(CloseConnection.class);
@ -55,8 +54,7 @@ final class CloseConnection extends SshCommand {
multiValued = true, multiValued = true,
required = true, required = true,
metaVar = "SESSION_ID", metaVar = "SESSION_ID",
usage = "List of SSH session IDs to be closed" usage = "List of SSH session IDs to be closed")
)
private final List<String> sessionIds = new ArrayList<>(); private final List<String> sessionIds = new ArrayList<>();
@Option(name = "--wait", usage = "wait for connection to close before exiting") @Option(name = "--wait", usage = "wait for connection to close before exiting")

View File

@ -45,8 +45,7 @@ final class CreateAccountCommand extends SshCommand {
name = "--group", name = "--group",
aliases = {"-g"}, aliases = {"-g"},
metaVar = "GROUP", metaVar = "GROUP",
usage = "groups to add account to" usage = "groups to add account to")
)
private List<AccountGroup.Id> groups = new ArrayList<>(); private List<AccountGroup.Id> groups = new ArrayList<>();
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account") @Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
@ -61,8 +60,7 @@ final class CreateAccountCommand extends SshCommand {
@Option( @Option(
name = "--http-password", name = "--http-password",
metaVar = "PASSWORD", metaVar = "PASSWORD",
usage = "password for HTTP authentication" usage = "password for HTTP authentication")
)
private String httpPassword; private String httpPassword;
@Argument(index = 0, required = true, metaVar = "USERNAME", usage = "name of the user account") @Argument(index = 0, required = true, metaVar = "USERNAME", usage = "name of the user account")

View File

@ -37,8 +37,7 @@ public final class CreateBranchCommand extends SshCommand {
index = 2, index = 2,
required = true, required = true,
metaVar = "REVISION", metaVar = "REVISION",
usage = "base revision of the new branch" usage = "base revision of the new branch")
)
private String revision; private String revision;
@Inject GerritApi gApi; @Inject GerritApi gApi;

View File

@ -53,16 +53,14 @@ final class CreateGroupCommand extends SshCommand {
name = "--owner", name = "--owner",
aliases = {"-o"}, aliases = {"-o"},
metaVar = "GROUP", metaVar = "GROUP",
usage = "owning group, if not specified the group will be self-owning" usage = "owning group, if not specified the group will be self-owning")
)
private AccountGroup.Id ownerGroupId; private AccountGroup.Id ownerGroupId;
@Option( @Option(
name = "--description", name = "--description",
aliases = {"-d"}, aliases = {"-d"},
metaVar = "DESC", metaVar = "DESC",
usage = "description of group" usage = "description of group")
)
private String groupDescription = ""; private String groupDescription = "";
@Argument(index = 0, required = true, metaVar = "GROUP", usage = "name of group to be created") @Argument(index = 0, required = true, metaVar = "GROUP", usage = "name of group to be created")
@ -74,8 +72,7 @@ final class CreateGroupCommand extends SshCommand {
name = "--member", name = "--member",
aliases = {"-m"}, aliases = {"-m"},
metaVar = "USERNAME", metaVar = "USERNAME",
usage = "initial set of users to become members of the group" usage = "initial set of users to become members of the group")
)
void addMember(Account.Id id) { void addMember(Account.Id id) {
initialMembers.add(id); initialMembers.add(id);
} }
@ -89,8 +86,7 @@ final class CreateGroupCommand extends SshCommand {
name = "--group", name = "--group",
aliases = "-g", aliases = "-g",
metaVar = "GROUP", metaVar = "GROUP",
usage = "initial set of groups to be included in the group" usage = "initial set of groups to be included in the group")
)
void addGroup(AccountGroup.UUID id) { void addGroup(AccountGroup.UUID id) {
initialGroups.add(id); initialGroups.add(id);
} }

View File

@ -43,31 +43,27 @@ import org.kohsuke.args4j.Option;
@RequiresCapability(GlobalCapability.CREATE_PROJECT) @RequiresCapability(GlobalCapability.CREATE_PROJECT)
@CommandMetaData( @CommandMetaData(
name = "create-project", name = "create-project",
description = "Create a new project and associated Git repository" description = "Create a new project and associated Git repository")
)
final class CreateProjectCommand extends SshCommand { final class CreateProjectCommand extends SshCommand {
@Option( @Option(
name = "--suggest-parents", name = "--suggest-parents",
aliases = {"-S"}, aliases = {"-S"},
usage = usage =
"suggest parent candidates, " "suggest parent candidates, "
+ "if this option is used all other options and arguments are ignored" + "if this option is used all other options and arguments are ignored")
)
private boolean suggestParent; private boolean suggestParent;
@Option( @Option(
name = "--owner", name = "--owner",
aliases = {"-o"}, aliases = {"-o"},
usage = "owner(s) of project" usage = "owner(s) of project")
)
private List<AccountGroup.UUID> ownerIds; private List<AccountGroup.UUID> ownerIds;
@Option( @Option(
name = "--parent", name = "--parent",
aliases = {"-p"}, aliases = {"-p"},
metaVar = "NAME", metaVar = "NAME",
usage = "parent project" usage = "parent project")
)
private ProjectControl newParent; private ProjectControl newParent;
@Option(name = "--permissions-only", usage = "create project for use only as parent") @Option(name = "--permissions-only", usage = "create project for use only as parent")
@ -77,15 +73,13 @@ final class CreateProjectCommand extends SshCommand {
name = "--description", name = "--description",
aliases = {"-d"}, aliases = {"-d"},
metaVar = "DESCRIPTION", metaVar = "DESCRIPTION",
usage = "description of project" usage = "description of project")
)
private String projectDescription = ""; private String projectDescription = "";
@Option( @Option(
name = "--submit-type", name = "--submit-type",
aliases = {"-t"}, aliases = {"-t"},
usage = "project submit type" usage = "project submit type")
)
private SubmitType submitType; private SubmitType submitType;
@Option(name = "--contributor-agreements", usage = "if contributor agreement is required") @Option(name = "--contributor-agreements", usage = "if contributor agreement is required")
@ -102,15 +96,13 @@ final class CreateProjectCommand extends SshCommand {
@Option( @Option(
name = "--new-change-for-all-not-in-target", name = "--new-change-for-all-not-in-target",
usage = "if a new change will be created for every commit not in target branch" usage = "if a new change will be created for every commit not in target branch")
)
private InheritableBoolean createNewChangeForAllNotInTarget = InheritableBoolean.INHERIT; private InheritableBoolean createNewChangeForAllNotInTarget = InheritableBoolean.INHERIT;
@Option( @Option(
name = "--use-contributor-agreements", name = "--use-contributor-agreements",
aliases = {"--ca"}, aliases = {"--ca"},
usage = "if contributor agreement is required" usage = "if contributor agreement is required")
)
void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) { void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) {
contributorAgreements = InheritableBoolean.TRUE; contributorAgreements = InheritableBoolean.TRUE;
} }
@ -118,8 +110,7 @@ final class CreateProjectCommand extends SshCommand {
@Option( @Option(
name = "--use-signed-off-by", name = "--use-signed-off-by",
aliases = {"--so"}, aliases = {"--so"},
usage = "if signed-off-by is required" usage = "if signed-off-by is required")
)
void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) { void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) {
signedOffBy = InheritableBoolean.TRUE; signedOffBy = InheritableBoolean.TRUE;
} }
@ -132,8 +123,7 @@ final class CreateProjectCommand extends SshCommand {
@Option( @Option(
name = "--require-change-id", name = "--require-change-id",
aliases = {"--id"}, aliases = {"--id"},
usage = "if change-id is required" usage = "if change-id is required")
)
void setRequireChangeId(@SuppressWarnings("unused") boolean on) { void setRequireChangeId(@SuppressWarnings("unused") boolean on) {
requireChangeID = InheritableBoolean.TRUE; requireChangeID = InheritableBoolean.TRUE;
} }
@ -141,8 +131,7 @@ final class CreateProjectCommand extends SshCommand {
@Option( @Option(
name = "--create-new-change-for-all-not-in-target", name = "--create-new-change-for-all-not-in-target",
aliases = {"--ncfa"}, aliases = {"--ncfa"},
usage = "if a new change will be created for every commit not in target branch" usage = "if a new change will be created for every commit not in target branch")
)
void setNewChangeForAllNotInTarget(@SuppressWarnings("unused") boolean on) { void setNewChangeForAllNotInTarget(@SuppressWarnings("unused") boolean on) {
createNewChangeForAllNotInTarget = InheritableBoolean.TRUE; createNewChangeForAllNotInTarget = InheritableBoolean.TRUE;
} }
@ -151,8 +140,7 @@ final class CreateProjectCommand extends SshCommand {
name = "--branch", name = "--branch",
aliases = {"-b"}, aliases = {"-b"},
metaVar = "BRANCH", metaVar = "BRANCH",
usage = "initial branch name\n(default: master)" usage = "initial branch name\n(default: master)")
)
private List<String> branch; private List<String> branch;
@Option(name = "--empty-commit", usage = "to create initial empty commit") @Option(name = "--empty-commit", usage = "to create initial empty commit")
@ -163,8 +151,7 @@ final class CreateProjectCommand extends SshCommand {
@Option( @Option(
name = "--plugin-config", name = "--plugin-config",
usage = "plugin configuration parameter with format '<plugin-name>.<parameter-name>=<value>'" usage = "plugin configuration parameter with format '<plugin-name>.<parameter-name>=<value>'")
)
private List<String> pluginConfigValues; private List<String> pluginConfigValues;
@Argument(index = 0, metaVar = "NAME", usage = "name of project to be created") @Argument(index = 0, metaVar = "NAME", usage = "name of project to be created")

View File

@ -39,8 +39,7 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "flush-caches", name = "flush-caches",
description = "Flush some/all server caches from memory", description = "Flush some/all server caches from memory",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
final class FlushCaches extends SshCommand { final class FlushCaches extends SshCommand {
@Option(name = "--cache", usage = "flush named cache", metaVar = "NAME") @Option(name = "--cache", usage = "flush named cache", metaVar = "NAME")
private List<String> caches = new ArrayList<>(); private List<String> caches = new ArrayList<>();

View File

@ -52,8 +52,7 @@ public class GarbageCollectionCommand extends SshCommand {
required = false, required = false,
multiValued = true, multiValued = true,
metaVar = "NAME", metaVar = "NAME",
usage = "projects for which the Git garbage collection should be run" usage = "projects for which the Git garbage collection should be run")
)
private List<ProjectControl> projects = new ArrayList<>(); private List<ProjectControl> projects = new ArrayList<>();
@Inject private ProjectCache projectCache; @Inject private ProjectCache projectCache;

View File

@ -38,8 +38,7 @@ final class IndexChangesCommand extends SshCommand {
required = true, required = true,
multiValued = true, multiValued = true,
metaVar = "CHANGE", metaVar = "CHANGE",
usage = "changes to index" usage = "changes to index")
)
void addChange(String token) { void addChange(String token) {
try { try {
changeArgumentParser.addChange(token, changes, null, false); changeArgumentParser.addChange(token, changes, null, false);

View File

@ -38,8 +38,7 @@ final class IndexProjectCommand extends SshCommand {
required = true, required = true,
multiValued = true, multiValued = true,
metaVar = "PROJECT", metaVar = "PROJECT",
usage = "projects for which the changes should be indexed" usage = "projects for which the changes should be indexed")
)
private List<ProjectControl> projects = new ArrayList<>(); private List<ProjectControl> projects = new ArrayList<>();
@Override @Override

View File

@ -35,8 +35,7 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "ls-groups", name = "ls-groups",
description = "List groups visible to the caller", description = "List groups visible to the caller",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
public class ListGroupsCommand extends SshCommand { public class ListGroupsCommand extends SshCommand {
@Inject private GroupCache groupCache; @Inject private GroupCache groupCache;
@ -48,8 +47,7 @@ public class ListGroupsCommand extends SshCommand {
usage = usage =
"verbose output format with tab-separated columns for the " "verbose output format with tab-separated columns for the "
+ "group name, UUID, description, owner group name, " + "group name, UUID, description, owner group name, "
+ "owner group UUID, and whether the group is visible to all" + "owner group UUID, and whether the group is visible to all")
)
private boolean verboseOutput; private boolean verboseOutput;
@Override @Override

View File

@ -31,8 +31,7 @@ import org.kohsuke.args4j.Argument;
@CommandMetaData( @CommandMetaData(
name = "ls-level", name = "ls-level",
description = "list the level of loggers", description = "list the level of loggers",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
public class ListLoggingLevelCommand extends SshCommand { public class ListLoggingLevelCommand extends SshCommand {
@Argument(index = 0, required = false, metaVar = "NAME", usage = "used to match loggers") @Argument(index = 0, required = false, metaVar = "NAME", usage = "used to match loggers")

View File

@ -39,8 +39,7 @@ import org.kohsuke.args4j.Argument;
@CommandMetaData( @CommandMetaData(
name = "ls-members", name = "ls-members",
description = "List the members of a given group", description = "List the members of a given group",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
public class ListMembersCommand extends SshCommand { public class ListMembersCommand extends SshCommand {
@Inject ListMembersCommandImpl impl; @Inject ListMembersCommandImpl impl;

View File

@ -26,8 +26,7 @@ import java.util.List;
@CommandMetaData( @CommandMetaData(
name = "ls-projects", name = "ls-projects",
description = "List projects visible to the caller", description = "List projects visible to the caller",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
public class ListProjectsCommand extends SshCommand { public class ListProjectsCommand extends SshCommand {
@Inject @Options public ListProjects impl; @Inject @Options public ListProjects impl;

View File

@ -44,8 +44,7 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "ls-user-refs", name = "ls-user-refs",
description = "List refs visible to a specific user", description = "List refs visible to a specific user",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
public class LsUserRefs extends SshCommand { public class LsUserRefs extends SshCommand {
@Inject private AccountResolver accountResolver; @Inject private AccountResolver accountResolver;
@Inject private OneOffRequestContext requestContext; @Inject private OneOffRequestContext requestContext;
@ -57,8 +56,7 @@ public class LsUserRefs extends SshCommand {
aliases = {"-p"}, aliases = {"-p"},
metaVar = "PROJECT", metaVar = "PROJECT",
required = true, required = true,
usage = "project for which the refs should be listed" usage = "project for which the refs should be listed")
)
private ProjectControl projectControl; private ProjectControl projectControl;
@Option( @Option(
@ -66,8 +64,7 @@ public class LsUserRefs extends SshCommand {
aliases = {"-u"}, aliases = {"-u"},
metaVar = "USER", metaVar = "USER",
required = true, required = true,
usage = "user for which the groups should be listed" usage = "user for which the groups should be listed")
)
private String userName; private String userName;
@Option(name = "--only-refs-heads", usage = "list only refs under refs/heads") @Option(name = "--only-refs-heads", usage = "list only refs under refs/heads")

View File

@ -39,8 +39,7 @@ final class PluginInstallCommand extends SshCommand {
@Option( @Option(
name = "--name", name = "--name",
aliases = {"-n"}, aliases = {"-n"},
usage = "install under name" usage = "install under name")
)
private String name; private String name;
@Option(name = "-") @Option(name = "-")

View File

@ -44,8 +44,7 @@ public class Query extends SshCommand {
@Option( @Option(
name = "--all-approvals", name = "--all-approvals",
usage = "Include information about all patch sets and approvals" usage = "Include information about all patch sets and approvals")
)
void setApprovals(boolean on) { void setApprovals(boolean on) {
if (on) { if (on) {
processor.setIncludePatchSets(on); processor.setIncludePatchSets(on);
@ -86,8 +85,7 @@ public class Query extends SshCommand {
@Option( @Option(
name = "--start", name = "--start",
aliases = {"-S"}, aliases = {"-S"},
usage = "Number of changes to skip" usage = "Number of changes to skip")
)
void setStart(int start) { void setStart(int start) {
processor.setStart(start); processor.setStart(start);
} }
@ -97,8 +95,7 @@ public class Query extends SshCommand {
required = true, required = true,
multiValued = true, multiValued = true,
metaVar = "QUERY", metaVar = "QUERY",
usage = "Query to execute" usage = "Query to execute")
)
private List<String> query; private List<String> query;
@Override @Override

View File

@ -47,8 +47,7 @@ import org.slf4j.LoggerFactory;
/** Receives change upload over SSH using the Git receive-pack protocol. */ /** Receives change upload over SSH using the Git receive-pack protocol. */
@CommandMetaData( @CommandMetaData(
name = "receive-pack", name = "receive-pack",
description = "Standard Git server side command for client side git push" description = "Standard Git server side command for client side git push")
)
final class Receive extends AbstractGitCommand { final class Receive extends AbstractGitCommand {
private static final Logger log = LoggerFactory.getLogger(Receive.class); private static final Logger log = LoggerFactory.getLogger(Receive.class);
@ -64,8 +63,7 @@ final class Receive extends AbstractGitCommand {
name = "--reviewer", name = "--reviewer",
aliases = {"--re"}, aliases = {"--re"},
metaVar = "EMAIL", metaVar = "EMAIL",
usage = "request reviewer for change(s)" usage = "request reviewer for change(s)")
)
void addReviewer(Account.Id id) { void addReviewer(Account.Id id) {
reviewers.put(ReviewerStateInternal.REVIEWER, id); reviewers.put(ReviewerStateInternal.REVIEWER, id);
} }
@ -74,8 +72,7 @@ final class Receive extends AbstractGitCommand {
name = "--cc", name = "--cc",
aliases = {}, aliases = {},
metaVar = "EMAIL", metaVar = "EMAIL",
usage = "CC user on change(s)" usage = "CC user on change(s)")
)
void addCC(Account.Id id) { void addCC(Account.Id id) {
reviewers.put(ReviewerStateInternal.CC, id); reviewers.put(ReviewerStateInternal.CC, id);
} }

View File

@ -33,8 +33,7 @@ public class RenameGroupCommand extends SshCommand {
index = 0, index = 0,
required = true, required = true,
metaVar = "GROUP", metaVar = "GROUP",
usage = "name of the group to be renamed" usage = "name of the group to be renamed")
)
private String groupName; private String groupName;
@Argument(index = 1, required = true, metaVar = "NEWNAME", usage = "new name of the group") @Argument(index = 1, required = true, metaVar = "NEWNAME", usage = "new name of the group")

View File

@ -77,8 +77,7 @@ public class ReviewCommand extends SshCommand {
required = true, required = true,
multiValued = true, multiValued = true,
metaVar = "{COMMIT | CHANGE,PATCHSET}", metaVar = "{COMMIT | CHANGE,PATCHSET}",
usage = "list of commits or patch sets to review" usage = "list of commits or patch sets to review")
)
void addPatchSetId(String token) { void addPatchSetId(String token) {
try { try {
PatchSet ps = psParser.parsePatchSet(token, projectControl, branch); PatchSet ps = psParser.parsePatchSet(token, projectControl, branch);
@ -93,8 +92,7 @@ public class ReviewCommand extends SshCommand {
@Option( @Option(
name = "--project", name = "--project",
aliases = "-p", aliases = "-p",
usage = "project containing the specified patch set(s)" usage = "project containing the specified patch set(s)")
)
private ProjectControl projectControl; private ProjectControl projectControl;
@Option(name = "--branch", aliases = "-b", usage = "branch containing the specified patch set(s)") @Option(name = "--branch", aliases = "-b", usage = "branch containing the specified patch set(s)")
@ -104,16 +102,14 @@ public class ReviewCommand extends SshCommand {
name = "--message", name = "--message",
aliases = "-m", aliases = "-m",
usage = "cover message to publish on change(s)", usage = "cover message to publish on change(s)",
metaVar = "MESSAGE" metaVar = "MESSAGE")
)
private String changeComment; private String changeComment;
@Option( @Option(
name = "--notify", name = "--notify",
aliases = "-n", aliases = "-n",
usage = "Who to send email notifications to after the review is stored.", usage = "Who to send email notifications to after the review is stored.",
metaVar = "NOTIFYHANDLING" metaVar = "NOTIFYHANDLING")
)
private NotifyHandling notify; private NotifyHandling notify;
@Option(name = "--abandon", usage = "abandon the specified change(s)") @Option(name = "--abandon", usage = "abandon the specified change(s)")
@ -138,16 +134,14 @@ public class ReviewCommand extends SshCommand {
name = "--tag", name = "--tag",
aliases = "-t", aliases = "-t",
usage = "applies a tag to the given review", usage = "applies a tag to the given review",
metaVar = "TAG" metaVar = "TAG")
)
private String changeTag; private String changeTag;
@Option( @Option(
name = "--label", name = "--label",
aliases = "-l", aliases = "-l",
usage = "custom label(s) to assign", usage = "custom label(s) to assign",
metaVar = "LABEL=VALUE" metaVar = "LABEL=VALUE")
)
void addLabel(String token) { void addLabel(String token) {
LabelVote v = LabelVote.parseWithEquals(token); LabelVote v = LabelVote.parseWithEquals(token);
LabelType.checkName(v.label()); // Disallow SUBM. LabelType.checkName(v.label()); // Disallow SUBM.

View File

@ -68,8 +68,7 @@ final class SetAccountCommand extends SshCommand {
index = 0, index = 0,
required = true, required = true,
metaVar = "USER", metaVar = "USER",
usage = "full name, email-address, ssh username or account id" usage = "full name, email-address, ssh username or account id")
)
private Account.Id id; private Account.Id id;
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account") @Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
@ -87,15 +86,13 @@ final class SetAccountCommand extends SshCommand {
@Option( @Option(
name = "--delete-email", name = "--delete-email",
metaVar = "EMAIL", metaVar = "EMAIL",
usage = "email addresses to delete from the account" usage = "email addresses to delete from the account")
)
private List<String> deleteEmails = new ArrayList<>(); private List<String> deleteEmails = new ArrayList<>();
@Option( @Option(
name = "--preferred-email", name = "--preferred-email",
metaVar = "EMAIL", metaVar = "EMAIL",
usage = "a registered email address from the account" usage = "a registered email address from the account")
)
private String preferredEmail; private String preferredEmail;
@Option(name = "--add-ssh-key", 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")
@ -104,15 +101,13 @@ final class SetAccountCommand extends SshCommand {
@Option( @Option(
name = "--delete-ssh-key", name = "--delete-ssh-key",
metaVar = "-|KEY", metaVar = "-|KEY",
usage = "public keys to delete from the account" usage = "public keys to delete from the account")
)
private List<String> deleteSshKeys = new ArrayList<>(); private List<String> deleteSshKeys = new ArrayList<>();
@Option( @Option(
name = "--http-password", name = "--http-password",
metaVar = "PASSWORD", metaVar = "PASSWORD",
usage = "password for HTTP authentication for the account" usage = "password for HTTP authentication for the account")
)
private String httpPassword; private String httpPassword;
@Option(name = "--clear-http-password", usage = "clear HTTP password for the account") @Option(name = "--clear-http-password", usage = "clear HTTP password for the account")

View File

@ -35,8 +35,7 @@ import org.kohsuke.args4j.Argument;
@CommandMetaData( @CommandMetaData(
name = "set-level", name = "set-level",
description = "Change the level of loggers", description = "Change the level of loggers",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
public class SetLoggingLevelCommand extends SshCommand { public class SetLoggingLevelCommand extends SshCommand {
private static final String LOG_CONFIGURATION = "log4j.properties"; private static final String LOG_CONFIGURATION = "log4j.properties";
private static final String JAVA_OPTIONS_LOG_CONFIG = "log4j.configuration"; private static final String JAVA_OPTIONS_LOG_CONFIG = "log4j.configuration";

View File

@ -45,40 +45,35 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "set-members", name = "set-members",
description = "Modify members of specific group or number of groups" description = "Modify members of specific group or number of groups")
)
public class SetMembersCommand extends SshCommand { public class SetMembersCommand extends SshCommand {
@Option( @Option(
name = "--add", name = "--add",
aliases = {"-a"}, aliases = {"-a"},
metaVar = "USER", metaVar = "USER",
usage = "users that should be added as group member" usage = "users that should be added as group member")
)
private List<Account.Id> accountsToAdd = new ArrayList<>(); private List<Account.Id> accountsToAdd = new ArrayList<>();
@Option( @Option(
name = "--remove", name = "--remove",
aliases = {"-r"}, aliases = {"-r"},
metaVar = "USER", metaVar = "USER",
usage = "users that should be removed from the group" usage = "users that should be removed from the group")
)
private List<Account.Id> accountsToRemove = new ArrayList<>(); private List<Account.Id> accountsToRemove = new ArrayList<>();
@Option( @Option(
name = "--include", name = "--include",
aliases = {"-i"}, aliases = {"-i"},
metaVar = "GROUP", metaVar = "GROUP",
usage = "group that should be included as group member" usage = "group that should be included as group member")
)
private List<AccountGroup.UUID> groupsToInclude = new ArrayList<>(); private List<AccountGroup.UUID> groupsToInclude = new ArrayList<>();
@Option( @Option(
name = "--exclude", name = "--exclude",
aliases = {"-e"}, aliases = {"-e"},
metaVar = "GROUP", metaVar = "GROUP",
usage = "group that should be excluded from the group" usage = "group that should be excluded from the group")
)
private List<AccountGroup.UUID> groupsToRemove = new ArrayList<>(); private List<AccountGroup.UUID> groupsToRemove = new ArrayList<>();
@Argument( @Argument(
@ -86,8 +81,7 @@ public class SetMembersCommand extends SshCommand {
required = true, required = true,
multiValued = true, multiValued = true,
metaVar = "GROUP", metaVar = "GROUP",
usage = "groups to modify" usage = "groups to modify")
)
private List<AccountGroup.UUID> groups = new ArrayList<>(); private List<AccountGroup.UUID> groups = new ArrayList<>();
@Inject private AddMembers addMembers; @Inject private AddMembers addMembers;

View File

@ -38,15 +38,13 @@ final class SetProjectCommand extends SshCommand {
name = "--description", name = "--description",
aliases = {"-d"}, aliases = {"-d"},
metaVar = "DESCRIPTION", metaVar = "DESCRIPTION",
usage = "description of project" usage = "description of project")
)
private String projectDescription; private String projectDescription;
@Option( @Option(
name = "--submit-type", name = "--submit-type",
aliases = {"-t"}, aliases = {"-t"},
usage = "project submit type\n(default: MERGE_IF_NECESSARY)" usage = "project submit type\n(default: MERGE_IF_NECESSARY)")
)
private SubmitType submitType; private SubmitType submitType;
@Option(name = "--contributor-agreements", usage = "if contributor agreement is required") @Option(name = "--contributor-agreements", usage = "if contributor agreement is required")
@ -64,8 +62,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--use-contributor-agreements", name = "--use-contributor-agreements",
aliases = {"--ca"}, aliases = {"--ca"},
usage = "if contributor agreement is required" usage = "if contributor agreement is required")
)
void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) { void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) {
contributorAgreements = InheritableBoolean.TRUE; contributorAgreements = InheritableBoolean.TRUE;
} }
@ -73,8 +70,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--no-contributor-agreements", name = "--no-contributor-agreements",
aliases = {"--nca"}, aliases = {"--nca"},
usage = "if contributor agreement is not required" usage = "if contributor agreement is not required")
)
void setNoContributorArgreements(@SuppressWarnings("unused") boolean on) { void setNoContributorArgreements(@SuppressWarnings("unused") boolean on) {
contributorAgreements = InheritableBoolean.FALSE; contributorAgreements = InheritableBoolean.FALSE;
} }
@ -82,8 +78,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--use-signed-off-by", name = "--use-signed-off-by",
aliases = {"--so"}, aliases = {"--so"},
usage = "if signed-off-by is required" usage = "if signed-off-by is required")
)
void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) { void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) {
signedOffBy = InheritableBoolean.TRUE; signedOffBy = InheritableBoolean.TRUE;
} }
@ -91,8 +86,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--no-signed-off-by", name = "--no-signed-off-by",
aliases = {"--nso"}, aliases = {"--nso"},
usage = "if signed-off-by is not required" usage = "if signed-off-by is not required")
)
void setNoSignedOffBy(@SuppressWarnings("unused") boolean on) { void setNoSignedOffBy(@SuppressWarnings("unused") boolean on) {
signedOffBy = InheritableBoolean.FALSE; signedOffBy = InheritableBoolean.FALSE;
} }
@ -104,8 +98,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--no-content-merge", name = "--no-content-merge",
usage = "don't allow automatic conflict resolving within files" usage = "don't allow automatic conflict resolving within files")
)
void setNoContentMerge(@SuppressWarnings("unused") boolean on) { void setNoContentMerge(@SuppressWarnings("unused") boolean on) {
contentMerge = InheritableBoolean.FALSE; contentMerge = InheritableBoolean.FALSE;
} }
@ -113,8 +106,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--require-change-id", name = "--require-change-id",
aliases = {"--id"}, aliases = {"--id"},
usage = "if change-id is required" usage = "if change-id is required")
)
void setRequireChangeId(@SuppressWarnings("unused") boolean on) { void setRequireChangeId(@SuppressWarnings("unused") boolean on) {
requireChangeID = InheritableBoolean.TRUE; requireChangeID = InheritableBoolean.TRUE;
} }
@ -122,8 +114,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--no-change-id", name = "--no-change-id",
aliases = {"--nid"}, aliases = {"--nid"},
usage = "if change-id is not required" usage = "if change-id is not required")
)
void setNoChangeId(@SuppressWarnings("unused") boolean on) { void setNoChangeId(@SuppressWarnings("unused") boolean on) {
requireChangeID = InheritableBoolean.FALSE; requireChangeID = InheritableBoolean.FALSE;
} }
@ -131,8 +122,7 @@ final class SetProjectCommand extends SshCommand {
@Option( @Option(
name = "--project-state", name = "--project-state",
aliases = {"--ps"}, aliases = {"--ps"},
usage = "project's visibility state" usage = "project's visibility state")
)
private ProjectState state; private ProjectState state;
@Option(name = "--max-object-size-limit", usage = "max Git object size for this project") @Option(name = "--max-object-size-limit", usage = "max Git object size for this project")

View File

@ -52,16 +52,14 @@ public class SetReviewersCommand extends SshCommand {
name = "--add", name = "--add",
aliases = {"-a"}, aliases = {"-a"},
metaVar = "REVIEWER", metaVar = "REVIEWER",
usage = "user or group that should be added as reviewer" usage = "user or group that should be added as reviewer")
)
private List<String> toAdd = new ArrayList<>(); private List<String> toAdd = new ArrayList<>();
@Option( @Option(
name = "--remove", name = "--remove",
aliases = {"-r"}, aliases = {"-r"},
metaVar = "REVIEWER", metaVar = "REVIEWER",
usage = "user that should be removed from the reviewer list" usage = "user that should be removed from the reviewer list")
)
void optionRemove(Account.Id who) { void optionRemove(Account.Id who) {
toRemove.add(who); toRemove.add(who);
} }
@ -71,8 +69,7 @@ public class SetReviewersCommand extends SshCommand {
required = true, required = true,
multiValued = true, multiValued = true,
metaVar = "CHANGE", metaVar = "CHANGE",
usage = "changes to modify" usage = "changes to modify")
)
void addChange(String token) { void addChange(String token) {
try { try {
changeArgumentParser.addChange(token, changes, projectControl); changeArgumentParser.addChange(token, changes, projectControl);

View File

@ -59,8 +59,7 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "show-caches", name = "show-caches",
description = "Display current cache statistics", description = "Display current cache statistics",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
final class ShowCaches extends SshCommand { final class ShowCaches extends SshCommand {
private static volatile long serverStarted; private static volatile long serverStarted;
@ -93,8 +92,7 @@ final class ShowCaches extends SshCommand {
name = "--width", name = "--width",
aliases = {"-w"}, aliases = {"-w"},
metaVar = "COLS", metaVar = "COLS",
usage = "width of output table" usage = "width of output table")
)
private int columns = 80; private int columns = 80;
private int nw; private int nw;

View File

@ -52,21 +52,18 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "show-connections", name = "show-connections",
description = "Display active client SSH connections", description = "Display active client SSH connections",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
final class ShowConnections extends SshCommand { final class ShowConnections extends SshCommand {
@Option( @Option(
name = "--numeric", name = "--numeric",
aliases = {"-n"}, aliases = {"-n"},
usage = "don't resolve names" usage = "don't resolve names")
)
private boolean numeric; private boolean numeric;
@Option( @Option(
name = "--wide", name = "--wide",
aliases = {"-w"}, aliases = {"-w"},
usage = "display without line width truncation" usage = "display without line width truncation")
)
private boolean wide; private boolean wide;
@Inject private SshDaemon daemon; @Inject private SshDaemon daemon;

View File

@ -47,21 +47,18 @@ import org.kohsuke.args4j.Option;
@CommandMetaData( @CommandMetaData(
name = "show-queue", name = "show-queue",
description = "Display the background work queues", description = "Display the background work queues",
runsAt = MASTER_OR_SLAVE runsAt = MASTER_OR_SLAVE)
)
final class ShowQueue extends SshCommand { final class ShowQueue extends SshCommand {
@Option( @Option(
name = "--wide", name = "--wide",
aliases = {"-w"}, aliases = {"-w"},
usage = "display without line width truncation" usage = "display without line width truncation")
)
private boolean wide; private boolean wide;
@Option( @Option(
name = "--by-queue", name = "--by-queue",
aliases = {"-q"}, aliases = {"-q"},
usage = "group tasks by queue and print queue info" usage = "group tasks by queue and print queue info")
)
private boolean groupByQueue; private boolean groupByQueue;
@Inject private PermissionBackend permissionBackend; @Inject private PermissionBackend permissionBackend;

View File

@ -63,8 +63,7 @@ final class StreamEvents extends BaseCommand {
name = "--subscribe", name = "--subscribe",
aliases = {"-s"}, aliases = {"-s"},
metaVar = "SUBSCRIBE", metaVar = "SUBSCRIBE",
usage = "subscribe to specific stream-events" usage = "subscribe to specific stream-events")
)
private List<String> subscribedToEvents = new ArrayList<>(); private List<String> subscribedToEvents = new ArrayList<>();
@Inject private IdentifiedUser currentUser; @Inject private IdentifiedUser currentUser;

View File

@ -63,8 +63,7 @@ public class UploadArchive extends AbstractGitCommand {
+ " resulting archive: tar or zip... If this option is not given, and" + " resulting archive: tar or zip... If this option is not given, and"
+ " the output file is specified, the format is inferred from the" + " the output file is specified, the format is inferred from the"
+ " filename if possible (e.g. writing to \"foo.zip\" makes the output" + " filename if possible (e.g. writing to \"foo.zip\" makes the output"
+ " to be in the zip format). Otherwise the output format is tar." + " to be in the zip format). Otherwise the output format is tar.")
)
private String format = "tar"; private String format = "tar";
@Option(name = "--prefix", usage = "Prepend <prefix>/ to each filename in the archive.") @Option(name = "--prefix", usage = "Prepend <prefix>/ to each filename in the archive.")
@ -102,8 +101,7 @@ public class UploadArchive extends AbstractGitCommand {
usage = usage =
"Highest and slowest compression level. You " "Highest and slowest compression level. You "
+ "can specify any number from 1 to 9 to adjust compression speed and " + "can specify any number from 1 to 9 to adjust compression speed and "
+ "ratio." + "ratio.")
)
private boolean level9; private boolean level9;
@Argument(index = 0, required = true, usage = "The tree or commit to produce an archive for.") @Argument(index = 0, required = true, usage = "The tree or commit to produce an archive for.")
@ -115,8 +113,7 @@ public class UploadArchive extends AbstractGitCommand {
usage = usage =
"Without an optional path parameter, all files and subdirectories of " "Without an optional path parameter, all files and subdirectories of "
+ "the current working directory are included in the archive. If one " + "the current working directory are included in the archive. If one "
+ "or more paths are specified, only these are included." + "or more paths are specified, only these are included.")
)
private List<String> path; private List<String> path;
} }