From ec6157b6ac1ee76c3f5f27ab3c26877fcf640957 Mon Sep 17 00:00:00 2001 From: Ben McIlwain Date: Thu, 20 Feb 2020 16:23:38 -0500 Subject: [PATCH] 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. --- .../java/google/registry/tools/CountDomainsCommand.java | 9 ++++++--- .../google/registry/tools/CountDomainsCommandTest.java | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/google/registry/tools/CountDomainsCommand.java b/core/src/main/java/google/registry/tools/CountDomainsCommand.java index 0d97ce6d6..0a9c46b01 100644 --- a/core/src/main/java/google/registry/tools/CountDomainsCommand.java +++ b/core/src/main/java/google/registry/tools/CountDomainsCommand.java @@ -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 mainParameters; + @Parameter( + names = {"-t", "--tld", "--tlds"}, + description = "Comma-delimited list of TLD(s) to count domains on", + required = true) + private List 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))); } diff --git a/core/src/test/java/google/registry/tools/CountDomainsCommandTest.java b/core/src/test/java/google/registry/tools/CountDomainsCommandTest.java index ee45954f2..f8c4f86e2 100644 --- a/core/src/test/java/google/registry/tools/CountDomainsCommandTest.java +++ b/core/src/test/java/google/registry/tools/CountDomainsCommandTest.java @@ -49,7 +49,7 @@ public class CountDomainsCommandTest extends CommandTestCase