mirror of
https://github.com/google/nomulus
synced 2026-01-05 04:56:03 +00:00
Enable command name autocomplete for nomulus tool
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137299749
This commit is contained in:
@@ -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<String, ? extends Class<? extends Command>> entry : commands.entrySet()) {
|
||||
System.out.println(entry.getKey());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
checkState(RegistryToolEnvironment.get() == environment,
|
||||
"RegistryToolEnvironment argument pre-processing kludge failed.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user