mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 16:07:15 +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.")
|
||||
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.");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue