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 08:43:46 +09:00
parent 0f6c9bd34c
commit edc6a492a8
68 changed files with 639 additions and 818 deletions

View File

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

View File

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

View File

@ -58,8 +58,7 @@ public class ServerInfoIT extends AbstractDaemonTest {
// download
@GerritConfig(
name = "download.archive",
values = {"tar", "tbz2", "tgz", "txz"}
)
values = {"tar", "tbz2", "tgz", "txz"})
// gerrit
@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.patterns",
values = {".+ser@example\\.com", "a@b\\.com"}
)
values = {".+ser@example\\.com", "a@b\\.com"})
public void listFilterWhitelistDoesNotFilterListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail();
// 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.patterns",
values = {".+@gerritcodereview\\.com", "a@b\\.com"}
)
values = {".+@gerritcodereview\\.com", "a@b\\.com"})
public void listFilterWhitelistFiltersNotListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail();
// 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.patterns",
values = {".+@gerritcodereview\\.com", "a@b\\.com"}
)
values = {".+@gerritcodereview\\.com", "a@b\\.com"})
public void listFilterBlacklistDoesNotFilterNotListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail();
// 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.patterns",
values = {".+@example\\.com", "a@b\\.com"}
)
values = {".+@example\\.com", "a@b\\.com"})
public void listFilterBlacklistFiltersListedUser() throws Exception {
ChangeInfo changeInfo = createChangeAndReplyByEmail();
// Check that the comments from the email have been persisted

View File

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

View File

@ -156,8 +156,7 @@ public class Daemon extends SiteProgram {
@Option(
name = "--init",
aliases = {"-i"},
usage = "Init site before starting the daemon"
)
usage = "Init site before starting the daemon")
private boolean doInit;
@Option(name = "--stop-only", usage = "Stop the daemon", hidden = true)

View File

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

View File

@ -44,8 +44,7 @@ public class MigrateAccountPatchReviewDb extends SiteProgram {
@Option(
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;
@Override

View File

@ -41,8 +41,7 @@ public class Passwd extends SiteProgram {
metaVar = "SECTION.KEY",
index = 0,
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;
@Argument(metaVar = "PASSWORD", index = 1, required = false, usage = "Password to set")

View File

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

View File

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

View File

@ -97,8 +97,7 @@ public class RebuildNoteDb extends SiteProgram {
@Option(
name = "--change",
usage = "Individual change numbers to rebuild; recommended for debugging only"
)
usage = "Individual change numbers to rebuild; recommended for debugging only")
private List<Integer> changes = new ArrayList<>();
private Injector dbInjector;

View File

@ -58,8 +58,7 @@ public class Reindex extends SiteProgram {
@Option(
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;
@Option(name = "--verbose", usage = "Output debug information for each change")

View File

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

View File

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

View File

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

View File

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

View File

@ -35,8 +35,7 @@ public class ListAccess implements RestReadView<TopLevelResource> {
name = "--project",
aliases = {"-p"},
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 final GetAccess getAccess;

View File

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

View File

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

View File

@ -377,8 +377,7 @@ public class ChangeEdits
@Option(
name = "--base",
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;
@Inject
@ -478,8 +477,7 @@ public class ChangeEdits
@Option(
name = "--base",
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;
@Inject

View File

@ -63,8 +63,7 @@ public class GetBlame implements RestReadView<FileResource> {
aliases = {"-b"},
usage =
"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;
@Inject

View File

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

View File

@ -41,8 +41,7 @@ public class SuggestChangeReviewers extends SuggestReviewers
@Option(
name = "--exclude-groups",
aliases = {"-e"},
usage = "exclude groups from query"
)
usage = "exclude groups from query")
boolean excludeGroups;
private final Provider<CurrentUser> self;

View File

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

View File

@ -1277,8 +1277,7 @@ public class ReceiveCommits {
@Option(
name = "--edit",
aliases = {"-e"},
usage = "upload as change edit"
)
usage = "upload as change edit")
boolean edit;
@Option(name = "--submit", usage = "immediately submit the change")
@ -1292,8 +1291,7 @@ public class ReceiveCommits {
usage =
"Notify handling that defines to whom email notifications "
+ "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.")
NotifyHandling notify = NotifyHandling.ALL;
@Option(name = "--notify-to", metaVar = "USER", usage = "user that should be notified")
@ -1309,8 +1307,7 @@ public class ReceiveCommits {
name = "--reviewer",
aliases = {"-r"},
metaVar = "EMAIL",
usage = "add reviewer to changes"
)
usage = "add reviewer to changes")
void reviewer(Account.Id id) {
reviewer.add(id);
}
@ -1329,8 +1326,7 @@ public class ReceiveCommits {
name = "--label",
aliases = {"-l"},
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 {
LabelVote v = LabelVote.parse(token);
try {
@ -1346,8 +1342,7 @@ public class ReceiveCommits {
name = "--message",
aliases = {"-m"},
metaVar = "MESSAGE",
usage = "Comment message to apply to the review"
)
usage = "Comment message to apply to the review")
void addMessage(final String token) {
// git push does not allow spaces in refs.
message = token.replace("_", " ");
@ -1357,8 +1352,7 @@ public class ReceiveCommits {
name = "--hashtag",
aliases = {"-t"},
metaVar = "HASHTAG",
usage = "add hashtag to changes"
)
usage = "add hashtag to changes")
void addHashtag(String token) throws CmdLineException {
if (!notesMigration.readChanges()) {
throw clp.reject("cannot add hashtags; noteDb is disabled");

View File

@ -82,16 +82,14 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option(
name = "--project",
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) {
projects.add(project);
}
@Option(
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) {
this.visibleToAll = visibleToAll;
}
@ -99,8 +97,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option(
name = "--user",
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) {
this.user = user;
}
@ -109,8 +106,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--owned",
usage =
"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) {
this.owned = owned;
}
@ -125,8 +121,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option(
name = "--query",
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) {
addGroup(uuid);
}
@ -134,8 +129,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option(
name = "--group",
aliases = {"-g"},
usage = "group to inspect"
)
usage = "group to inspect")
public void addGroup(AccountGroup.UUID uuid) {
groupsToInspect.add(uuid);
}
@ -144,8 +138,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--limit",
aliases = {"-n"},
metaVar = "CNT",
usage = "maximum number of groups to list"
)
usage = "maximum number of groups to list")
public void setLimit(int limit) {
this.limit = limit;
}
@ -154,8 +147,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--start",
aliases = {"-S"},
metaVar = "CNT",
usage = "number of groups to skip"
)
usage = "number of groups to skip")
public void setStart(int start) {
this.start = start;
}
@ -164,8 +156,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
name = "--match",
aliases = {"-m"},
metaVar = "MATCH",
usage = "match group substring"
)
usage = "match group substring")
public void setMatchSubstring(String matchSubstring) {
this.matchSubstring = matchSubstring;
}
@ -173,8 +164,7 @@ public class ListGroups implements RestReadView<TopLevelResource> {
@Option(
name = "--suggest",
aliases = {"-s"},
usage = "to get a suggestion of groups"
)
usage = "to get a suggestion of groups")
public void setSuggest(String suggest) {
this.suggest = suggest;
}

View File

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

View File

@ -46,8 +46,7 @@ public class ListPlugins implements RestReadView<TopLevelResource> {
@Option(
name = "--all",
aliases = {"-a"},
usage = "List all plugins, including disabled plugins"
)
usage = "List all plugins, including disabled plugins")
private boolean all;
@Inject

View File

@ -52,8 +52,7 @@ public class CheckMergeability implements RestReadView<BranchResource> {
"the source reference to merge, which could be any git object "
+ "references expression, refer to "
+ "org.eclipse.jgit.lib.Repository#resolve(String)",
required = true
)
required = true)
public void setSource(String source) {
this.source = source;
}
@ -61,8 +60,7 @@ public class CheckMergeability implements RestReadView<BranchResource> {
@Option(
name = "--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) {
this.strategy = strategy;
}

View File

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

View File

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

View File

@ -120,8 +120,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
@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) {
showBranch.add(branch);
}
@ -131,8 +130,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
aliases = {"-t"},
usage =
"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) {
this.showTree = showTree;
}
@ -145,8 +143,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
@Option(
name = "--description",
aliases = {"-d"},
usage = "include description of project in list"
)
usage = "include description of project in list")
public void setShowDescription(boolean showDescription) {
this.showDescription = showDescription;
}
@ -160,8 +157,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--limit",
aliases = {"-n"},
metaVar = "CNT",
usage = "maximum number of projects to list"
)
usage = "maximum number of projects to list")
public void setLimit(int limit) {
this.limit = limit;
}
@ -170,8 +166,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--start",
aliases = {"-S"},
metaVar = "CNT",
usage = "number of projects to skip"
)
usage = "number of projects to skip")
public void setStart(int start) {
this.start = start;
}
@ -180,8 +175,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--prefix",
aliases = {"-p"},
metaVar = "PREFIX",
usage = "match project prefix"
)
usage = "match project prefix")
public void setMatchPrefix(String matchPrefix) {
this.matchPrefix = matchPrefix;
}
@ -190,8 +184,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
name = "--match",
aliases = {"-m"},
metaVar = "MATCH",
usage = "match project substring"
)
usage = "match project substring")
public void setMatchSubstring(String matchSubstring) {
this.matchSubstring = matchSubstring;
}
@ -204,8 +197,7 @@ public class ListProjects implements RestReadView<TopLevelResource> {
@Option(
name = "--has-acl-for",
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) {
this.groupUuid = groupUuid;
}

View File

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

View File

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

View File

@ -45,8 +45,7 @@ import org.slf4j.LoggerFactory;
@RequiresCapability(GlobalCapability.ADMINISTRATE_SERVER)
@CommandMetaData(
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 {
private static final Logger log = LoggerFactory.getLogger(AdminSetParent.class);
@ -54,22 +53,19 @@ final class AdminSetParent extends SshCommand {
name = "--parent",
aliases = {"-p"},
metaVar = "NAME",
usage = "new parent project"
)
usage = "new parent project")
private ProjectControl newParent;
@Option(
name = "--children-of",
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;
@Option(
name = "--exclude",
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<>();
@Argument(
@ -77,8 +73,7 @@ final class AdminSetParent extends SshCommand {
required = false,
multiValued = true,
metaVar = "NAME",
usage = "projects to modify"
)
usage = "projects to modify")
private List<ProjectControl> children = new ArrayList<>();
@Inject private ProjectCache projectCache;

View File

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

View File

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

View File

@ -44,15 +44,13 @@ abstract class BaseTestPrologCommand extends SshCommand {
@Option(
name = "-s",
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;
@Option(
name = "--no-filters",
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) {
input.filters = no ? Filters.SKIP : Filters.RUN;
}

View File

@ -42,8 +42,7 @@ import org.slf4j.LoggerFactory;
@CommandMetaData(
name = "close-connection",
description = "Close the specified SSH connection",
runsAt = MASTER_OR_SLAVE
)
runsAt = MASTER_OR_SLAVE)
final class CloseConnection extends SshCommand {
private static final Logger log = LoggerFactory.getLogger(CloseConnection.class);
@ -55,8 +54,7 @@ final class CloseConnection extends SshCommand {
multiValued = true,
required = true,
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<>();
@Option(name = "--wait", usage = "wait for connection to close before exiting")

View File

@ -45,8 +45,7 @@ final class CreateAccountCommand extends SshCommand {
name = "--group",
aliases = {"-g"},
metaVar = "GROUP",
usage = "groups to add account to"
)
usage = "groups to add account to")
private List<AccountGroup.Id> groups = new ArrayList<>();
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
@ -61,8 +60,7 @@ final class CreateAccountCommand extends SshCommand {
@Option(
name = "--http-password",
metaVar = "PASSWORD",
usage = "password for HTTP authentication"
)
usage = "password for HTTP authentication")
private String httpPassword;
@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,
required = true,
metaVar = "REVISION",
usage = "base revision of the new branch"
)
usage = "base revision of the new branch")
private String revision;
@Inject GerritApi gApi;

View File

@ -52,16 +52,14 @@ final class CreateGroupCommand extends SshCommand {
name = "--owner",
aliases = {"-o"},
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;
@Option(
name = "--description",
aliases = {"-d"},
metaVar = "DESC",
usage = "description of group"
)
usage = "description of group")
private String groupDescription = "";
@Argument(index = 0, required = true, metaVar = "GROUP", usage = "name of group to be created")
@ -73,8 +71,7 @@ final class CreateGroupCommand extends SshCommand {
name = "--member",
aliases = {"-m"},
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(final Account.Id id) {
initialMembers.add(id);
}
@ -88,8 +85,7 @@ final class CreateGroupCommand extends SshCommand {
name = "--group",
aliases = "-g",
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(final AccountGroup.UUID id) {
initialGroups.add(id);
}

View File

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

View File

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

View File

@ -52,8 +52,7 @@ public class GarbageCollectionCommand extends SshCommand {
required = false,
multiValued = true,
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<>();
@Inject private ProjectCache projectCache;

View File

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

View File

@ -38,8 +38,7 @@ final class IndexProjectCommand extends SshCommand {
required = true,
multiValued = true,
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<>();
@Override

View File

@ -41,8 +41,7 @@ import org.kohsuke.args4j.Option;
@CommandMetaData(
name = "ls-groups",
description = "List groups visible to the caller",
runsAt = MASTER_OR_SLAVE
)
runsAt = MASTER_OR_SLAVE)
public class ListGroupsCommand extends SshCommand {
@Inject private MyListGroups impl;
@ -66,8 +65,7 @@ public class ListGroupsCommand extends SshCommand {
usage =
"verbose output format with tab-separated columns for the "
+ "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;
@Inject

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -44,8 +44,7 @@ class Query extends SshCommand {
@Option(
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) {
if (on) {
processor.setIncludePatchSets(on);
@ -86,8 +85,7 @@ class Query extends SshCommand {
@Option(
name = "--start",
aliases = {"-S"},
usage = "Number of changes to skip"
)
usage = "Number of changes to skip")
void setStart(int start) {
processor.setStart(start);
}
@ -97,8 +95,7 @@ class Query extends SshCommand {
required = true,
multiValued = true,
metaVar = "QUERY",
usage = "Query to execute"
)
usage = "Query to execute")
private List<String> query;
@Override

View File

@ -43,8 +43,7 @@ import org.slf4j.LoggerFactory;
/** Receives change upload over SSH using the Git receive-pack protocol. */
@CommandMetaData(
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 {
private static final Logger log = LoggerFactory.getLogger(Receive.class);
@ -59,8 +58,7 @@ final class Receive extends AbstractGitCommand {
name = "--reviewer",
aliases = {"--re"},
metaVar = "EMAIL",
usage = "request reviewer for change(s)"
)
usage = "request reviewer for change(s)")
void addReviewer(final Account.Id id) {
reviewerId.add(id);
}
@ -69,8 +67,7 @@ final class Receive extends AbstractGitCommand {
name = "--cc",
aliases = {},
metaVar = "EMAIL",
usage = "CC user on change(s)"
)
usage = "CC user on change(s)")
void addCC(final Account.Id id) {
ccId.add(id);
}

View File

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

View File

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

View File

@ -67,8 +67,7 @@ final class SetAccountCommand extends SshCommand {
index = 0,
required = true,
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;
@Option(name = "--full-name", metaVar = "NAME", usage = "display name of the account")
@ -86,15 +85,13 @@ final class SetAccountCommand extends SshCommand {
@Option(
name = "--delete-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<>();
@Option(
name = "--preferred-email",
metaVar = "EMAIL",
usage = "a registered email address from the account"
)
usage = "a registered email address from the account")
private String preferredEmail;
@Option(name = "--add-ssh-key", metaVar = "-|KEY", usage = "public keys to add to the account")
@ -103,15 +100,13 @@ final class SetAccountCommand extends SshCommand {
@Option(
name = "--delete-ssh-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<>();
@Option(
name = "--http-password",
metaVar = "PASSWORD",
usage = "password for HTTP authentication for the account"
)
usage = "password for HTTP authentication for the account")
private String httpPassword;
@Option(name = "--clear-http-password", usage = "clear HTTP password for the account")

View File

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

View File

@ -43,40 +43,35 @@ import org.kohsuke.args4j.Option;
@CommandMetaData(
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 {
@Option(
name = "--add",
aliases = {"-a"},
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<>();
@Option(
name = "--remove",
aliases = {"-r"},
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<>();
@Option(
name = "--include",
aliases = {"-i"},
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<>();
@Option(
name = "--exclude",
aliases = {"-e"},
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<>();
@Argument(
@ -84,8 +79,7 @@ public class SetMembersCommand extends SshCommand {
required = true,
multiValued = true,
metaVar = "GROUP",
usage = "groups to modify"
)
usage = "groups to modify")
private List<AccountGroup.UUID> groups = new ArrayList<>();
@Inject private AddMembers addMembers;

View File

@ -44,15 +44,13 @@ final class SetProjectCommand extends SshCommand {
name = "--description",
aliases = {"-d"},
metaVar = "DESCRIPTION",
usage = "description of project"
)
usage = "description of project")
private String projectDescription;
@Option(
name = "--submit-type",
aliases = {"-t"},
usage = "project submit type\n(default: MERGE_IF_NECESSARY)"
)
usage = "project submit type\n(default: MERGE_IF_NECESSARY)")
private SubmitType submitType;
@Option(name = "--contributor-agreements", usage = "if contributor agreement is required")
@ -70,8 +68,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
name = "--use-contributor-agreements",
aliases = {"--ca"},
usage = "if contributor agreement is required"
)
usage = "if contributor agreement is required")
void setUseContributorArgreements(@SuppressWarnings("unused") boolean on) {
contributorAgreements = InheritableBoolean.TRUE;
}
@ -79,8 +76,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
name = "--no-contributor-agreements",
aliases = {"--nca"},
usage = "if contributor agreement is not required"
)
usage = "if contributor agreement is not required")
void setNoContributorArgreements(@SuppressWarnings("unused") boolean on) {
contributorAgreements = InheritableBoolean.FALSE;
}
@ -88,8 +84,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
name = "--use-signed-off-by",
aliases = {"--so"},
usage = "if signed-off-by is required"
)
usage = "if signed-off-by is required")
void setUseSignedOffBy(@SuppressWarnings("unused") boolean on) {
signedOffBy = InheritableBoolean.TRUE;
}
@ -97,8 +92,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
name = "--no-signed-off-by",
aliases = {"--nso"},
usage = "if signed-off-by is not required"
)
usage = "if signed-off-by is not required")
void setNoSignedOffBy(@SuppressWarnings("unused") boolean on) {
signedOffBy = InheritableBoolean.FALSE;
}
@ -110,8 +104,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
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) {
contentMerge = InheritableBoolean.FALSE;
}
@ -119,8 +112,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
name = "--require-change-id",
aliases = {"--id"},
usage = "if change-id is required"
)
usage = "if change-id is required")
void setRequireChangeId(@SuppressWarnings("unused") boolean on) {
requireChangeID = InheritableBoolean.TRUE;
}
@ -128,8 +120,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
name = "--no-change-id",
aliases = {"--nid"},
usage = "if change-id is not required"
)
usage = "if change-id is not required")
void setNoChangeId(@SuppressWarnings("unused") boolean on) {
requireChangeID = InheritableBoolean.FALSE;
}
@ -137,8 +128,7 @@ final class SetProjectCommand extends SshCommand {
@Option(
name = "--project-state",
aliases = {"--ps"},
usage = "project's visibility state"
)
usage = "project's visibility state")
private ProjectState state;
@Option(name = "--max-object-size-limit", usage = "max Git object size for this project")

View File

@ -51,16 +51,14 @@ public class SetReviewersCommand extends SshCommand {
name = "--add",
aliases = {"-a"},
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<>();
@Option(
name = "--remove",
aliases = {"-r"},
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) {
toRemove.add(who);
}
@ -70,8 +68,7 @@ public class SetReviewersCommand extends SshCommand {
required = true,
multiValued = true,
metaVar = "CHANGE",
usage = "changes to modify"
)
usage = "changes to modify")
void addChange(String token) {
try {
changeArgumentParser.addChange(token, changes, projectControl);

View File

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

View File

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

View File

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

View File

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

View File

@ -58,8 +58,7 @@ public class UploadArchive extends AbstractGitCommand {
+ " resulting archive: tar or zip... If this option is not given, and"
+ " the output file is specified, the format is inferred from the"
+ " 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";
@Option(name = "--prefix", usage = "Prepend <prefix>/ to each filename in the archive.")
@ -97,8 +96,7 @@ public class UploadArchive extends AbstractGitCommand {
usage =
"Highest and slowest compression level. You "
+ "can specify any number from 1 to 9 to adjust compression speed and "
+ "ratio."
)
+ "ratio.")
private boolean level9;
@Argument(index = 0, required = true, usage = "The tree or commit to produce an archive for.")
@ -110,8 +108,7 @@ public class UploadArchive extends AbstractGitCommand {
usage =
"Without an optional path parameter, all files and subdirectories of "
+ "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;
}