mirror of
https://github.com/google/nomulus.git
synced 2025-05-14 00:17:20 +02: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:
parent
198558901d
commit
1b7cee61a5
1 changed files with 12 additions and 0 deletions
|
@ -42,6 +42,11 @@ final class RegistryCli {
|
||||||
description = "Sets the default environment to run the command.")
|
description = "Sets the default environment to run the command.")
|
||||||
private RegistryToolEnvironment environment = RegistryToolEnvironment.PRODUCTION;
|
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.
|
// Do not make this final - compile-time constant inlining may interfere with JCommander.
|
||||||
@ParametersDelegate
|
@ParametersDelegate
|
||||||
private AppEngineConnection connection = new AppEngineConnection();
|
private AppEngineConnection connection = new AppEngineConnection();
|
||||||
|
@ -94,6 +99,13 @@ final class RegistryCli {
|
||||||
throw e;
|
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,
|
checkState(RegistryToolEnvironment.get() == environment,
|
||||||
"RegistryToolEnvironment argument pre-processing kludge failed.");
|
"RegistryToolEnvironment argument pre-processing kludge failed.");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue