summaryrefslogtreecommitdiff
path: root/java/com/google/devtools/common/options/OptionsParserImpl.java
diff options
context:
space:
mode:
authorccalvarin <ccalvarin@google.com>2017-09-26 14:42:31 -0400
committerColin Cross <ccross@android.com>2017-10-24 12:20:16 -0700
commita0d433e79adbd70bc30ee613654fdf3fbb9de991 (patch)
treeaab5fc4657c7c93ab18d2ae2f13536679c1a303d /java/com/google/devtools/common/options/OptionsParserImpl.java
parent05bb5c28c6be8320c06d8bb1bafd0be586678138 (diff)
downloaddesugar-a0d433e79adbd70bc30ee613654fdf3fbb9de991.tar.gz
Move the canonicalization of an option value to the option value itself.
Ideally, the canonical form we output from OptionUtils would be the same as for the command canonicalize-flags, but that must wait for dependencies to be cleaned up. Still, in the meantime, keep the --foo=1 normalization of --foo, and apply it to all other boolean flag values (t,true,yes,y, and false equivalents), so that the canoncalize-flags output is more canonical, even if it isn't using the --[no]foo form yet. RELNOTES: Boolean flag values will now get normalized to 1 or 0 in canonicalize-flags output. PiperOrigin-RevId: 170084599 GitOrigin-RevId: 659feca7dee332f75801010b018505b7ba5a185e Change-Id: I65e969918c0ce0129d52e3fcdda4d95cde5175b7
Diffstat (limited to 'java/com/google/devtools/common/options/OptionsParserImpl.java')
-rw-r--r--java/com/google/devtools/common/options/OptionsParserImpl.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/java/com/google/devtools/common/options/OptionsParserImpl.java b/java/com/google/devtools/common/options/OptionsParserImpl.java
index 176d51e..221dcf0 100644
--- a/java/com/google/devtools/common/options/OptionsParserImpl.java
+++ b/java/com/google/devtools/common/options/OptionsParserImpl.java
@@ -158,12 +158,7 @@ class OptionsParserImpl {
})
// Ignore expansion options.
.filter(value -> !value.getOptionDefinition().isExpansionOption())
- .map(
- value ->
- "--"
- + value.getOptionDefinition().getOptionName()
- + "="
- + value.getUnconvertedValue())
+ .map(ParsedOptionDescription::getDeprecatedCanonicalForm)
.collect(toCollection(ArrayList::new));
}