diff --git a/java/google/registry/tools/RegistryCli.java b/java/google/registry/tools/RegistryCli.java index fda49e71c..392a503f8 100644 --- a/java/google/registry/tools/RegistryCli.java +++ b/java/google/registry/tools/RegistryCli.java @@ -42,6 +42,11 @@ final class RegistryCli { description = "Sets the default environment to run the command.") private RegistryToolEnvironment environment = RegistryToolEnvironment.PRODUCTION; + @Parameter( + names = {"-c", "--commands"}, + description = "Returns all command names.") + private boolean showAllCommands; + // Do not make this final - compile-time constant inlining may interfere with JCommander. @ParametersDelegate private AppEngineConnection connection = new AppEngineConnection(); @@ -94,6 +99,13 @@ final class RegistryCli { throw e; } + if (showAllCommands) { + for (Map.Entry> entry : commands.entrySet()) { + System.out.println(entry.getKey()); + } + return; + } + checkState(RegistryToolEnvironment.get() == environment, "RegistryToolEnvironment argument pre-processing kludge failed.");