From a81d5cb6130c7bdf94851975069056e151e8daf9 Mon Sep 17 00:00:00 2001 From: gmeilen Date: Mon, 11 Jul 2016 13:45:39 -0700 Subject: [PATCH] GEODE-1598: fix auto-completion problems by telling jopt that all options are optional Spring shell, jopt-simple and Geode GFSH code all duplicated the concept of required options. jopt-simple can be blind to this, which prevents OptionParser.parse from throwing an Exception when a required option is missing at time of hitting tab for auto-complete. This allows OptionParser to return an OptionSet containing all detected options which is necessary for auto-completion to behave correctly. --- .../internal/cli/parser/jopt/JoptOptionParser.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java index 18ea5817bcb3..82760c8f5d7f 100644 --- a/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java +++ b/geode-core/src/main/java/com/gemstone/gemfire/management/internal/cli/parser/jopt/JoptOptionParser.java @@ -103,9 +103,10 @@ private void addJoptOptionObject(Option option) { argumentSpecs = optionBuilder.withOptionalArg(); } - if (option.isRequired()) { - argumentSpecs.required(); - } + // TODO: temporarily commented out as workaround for GEODE-1598 + // if (option.isRequired()) { + // argumentSpecs.required(); + // } if (option.getValueSeparator() != null) { argumentSpecs.withValuesSeparatedBy(option.getValueSeparator()); }