From 7a4a4ba3d5e7d8580471ea8f16c4c6b00d43381a Mon Sep 17 00:00:00 2001 From: mcilwain Date: Mon, 18 Jun 2018 12:23:08 -0700 Subject: [PATCH] Remove unused ShellCommand.JCommanderCompletor.getParamDoc() ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=201038811 --- java/google/registry/tools/ShellCommand.java | 23 +++----------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/java/google/registry/tools/ShellCommand.java b/java/google/registry/tools/ShellCommand.java index a251ac96c..3db3b640a 100644 --- a/java/google/registry/tools/ShellCommand.java +++ b/java/google/registry/tools/ShellCommand.java @@ -269,6 +269,9 @@ public class ShellCommand implements Command { @VisibleForTesting static class JCommanderCompletor implements Completor { + private static final ParamDoc DEFAULT_PARAM_DOC = + ParamDoc.create("[No documentation available]", ImmutableList.of()); + /** * Documentation for all the known command + argument combinations. * @@ -504,26 +507,6 @@ public class ShellCommand implements Command { isFlagParameter ? "Flag documentation" : "Main parameter", paramDoc.documentation()); return ImmutableList.of("", documentation); } - - private static final ParamDoc DEFAULT_PARAM_DOC = - ParamDoc.create("[No documentation available]", ImmutableList.of()); - - private @Nullable ParamDoc getParamDoc(String command, @Nullable String previousArgument) { - // First, check if we want the documentation for a specific flag, or for the "main" - // parameters. - // - // We want documentation for a flag if the previous argument was a flag, but the value of the - // flag wasn't set. So if the previous argument is "--flag" then we want documentation of that - // flag, but if it's "--flag=value" then that flag is set and we want documentation of the - // main parameters. - boolean isFlagParameter = - previousArgument != null - && previousArgument.startsWith("-") - && previousArgument.indexOf('=') == -1; - return Optional.ofNullable( - commandFlagDocs.get(command, isFlagParameter ? previousArgument : "")) - .orElse(DEFAULT_PARAM_DOC); - } } /**