ListGroups: Accept --ownedby as an alias of --owned-by
In the release notes of 2.16 and documentation, the --owned-by option
was incorrectly documented as --ownedBy which resulted in an error if
it was used:
"--ownedby" is not a valid option
The documentation has been fixed, but --ownedBy will still result in
an error for anyone who refers to the outdated documentation.
Add --ownedby as an alias of --owned-by so that it will work if either
is given.
Bug: Issue 12698
Change-Id: I6229b191b59d8c0bc65105ae5817104c3b40863c
diff --git a/java/com/google/gerrit/server/restapi/group/ListGroups.java b/java/com/google/gerrit/server/restapi/group/ListGroups.java
index 2567f6a..7fe9e90 100644
--- a/java/com/google/gerrit/server/restapi/group/ListGroups.java
+++ b/java/com/google/gerrit/server/restapi/group/ListGroups.java
@@ -205,7 +205,10 @@
options.addAll(ListGroupsOption.fromBits(Integer.parseInt(hex, 16)));
}
- @Option(name = "--owned-by", usage = "list groups owned by the given group uuid")
+ @Option(
+ name = "--owned-by",
+ aliases = {"--ownedby"},
+ usage = "list groups owned by the given group uuid")
public void setOwnedBy(String ownedBy) {
this.ownedBy = ownedBy;
}