SSH query command: Add --start n option to skip n changes

Change-Id: If5031ce1a91a4fa68828241f1dfcf0c54f58652e
This commit is contained in:
David Ostrovsky 2014-08-09 03:32:08 +02:00 committed by Dave Borowitz
parent 70b4f8f703
commit 6855018bb3
3 changed files with 11 additions and 1 deletions

View File

@ -15,6 +15,7 @@ gerrit query - Query the change database
[--dependencies] [--dependencies]
[--submit-records] [--submit-records]
[--all-reviewers] [--all-reviewers]
[--start <n> | -S <n>]
[--] [--]
<query> <query>
[limit:<n>] [limit:<n>]
@ -95,6 +96,10 @@ command line parser in the server).
includes whether the change meets the criteria for submission includes whether the change meets the criteria for submission
(including information for each review label). (including information for each review label).
--start::
-S::
Number of changes to skip.
limit:<n>:: limit:<n>::
Maximum number of results to return. This is actually a Maximum number of results to return. This is actually a
query operator, and not a command line option. If more query operator, and not a command line option. If more

View File

@ -146,7 +146,7 @@ public class QueryProcessor {
limit = n; limit = n;
} }
void setStart(int n) { public void setStart(int n) {
start = n; start = n;
} }

View File

@ -85,6 +85,11 @@ class Query extends SshCommand {
processor.setIncludeSubmitRecords(on); processor.setIncludeSubmitRecords(on);
} }
@Option(name = "--start", aliases = {"-S"}, usage = "Number of changes to skip")
void setStart(int start) {
processor.setStart(start);
}
@Argument(index = 0, required = true, multiValued = true, metaVar = "QUERY", usage = "Query to execute") @Argument(index = 0, required = true, multiValued = true, metaVar = "QUERY", usage = "Query to execute")
private List<String> query; private List<String> query;