Inline calls to get command from jcommander

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=191338771
This commit is contained in:
mmuller 2018-04-02 13:29:00 -07:00 committed by Ben McIlwain
parent 18290911a0
commit 3dff2ba4c7

View file

@ -131,8 +131,10 @@ final class RegistryCli implements AutoCloseable, CommandRunner {
// JCommander stores sub-commands as nested JCommander objects containing a list of user objects
// to be populated. Extract the subcommand by getting the JCommander wrapper and then
// retrieving the first (and, by virtue of our usage, only) object from it.
JCommander jcCommand = jcommander.getCommands().get(jcommander.getParsedCommand());
Command command = (Command) Iterables.getOnlyElement(jcCommand.getObjects());
Command command =
(Command)
Iterables.getOnlyElement(
jcommander.getCommands().get(jcommander.getParsedCommand()).getObjects());
loggingParams.configureLogging(); // Must be called after parameters are parsed.
try {