mirror of
https://github.com/google/nomulus
synced 2026-09-19 06:32:00 +00:00
Use -t instead of main params for TLDs in nomulus count_domains command (#493)
* Use -t instead of main params for TLDs in nomulus count_domains command This makes the command consistent with list_domains. I use both frequently and it was annoying forgetting which one takes -t and which uses main parameters. Now they both work the same way.
This commit is contained in:
@@ -30,15 +30,18 @@ import org.joda.time.DateTime;
|
||||
@Parameters(separators = " =", commandDescription = "Show count of domains on TLD")
|
||||
final class CountDomainsCommand implements CommandWithRemoteApi {
|
||||
|
||||
@Parameter(description = "TLD(s) to count domains on", required = true)
|
||||
private List<String> mainParameters;
|
||||
@Parameter(
|
||||
names = {"-t", "--tld", "--tlds"},
|
||||
description = "Comma-delimited list of TLD(s) to count domains on",
|
||||
required = true)
|
||||
private List<String> tlds;
|
||||
|
||||
@Inject Clock clock;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DateTime now = clock.nowUtc();
|
||||
assertTldsExist(mainParameters)
|
||||
assertTldsExist(tlds)
|
||||
.forEach(tld -> System.out.printf("%s,%d\n", tld, getCountForTld(tld, now)));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user