Track all option instances.
Regardless of option type, have the OptionValueDescription track information about the parsed option. This does not yet change the values that we output as part of the GotOptionsEvent, as the expansion, implicit req, and wrapper options still don't actually track anything in their option value.
RELNOTES: None.
@@ -341,8 +341,15 @@ class OptionsParserImpl {
OptionDefinition optionDefinition = parsedOption.getOptionDefinition();
// All options can be deprecated; check and warn before doing any option-type specific work.
maybeAddDeprecationWarning(optionDefinition);
- @Nullable String unconvertedValue = parsedOption.getUnconvertedValue();
+ // Track the value, before any remaining option-type specific work that is done outside of
+ // the OptionValueDescription.
+ OptionValueDescription entry =
+ optionValues.computeIfAbsent(
+ optionDefinition, OptionValueDescription::createOptionValueDescription);
+ entry.addOptionInstance(parsedOption, implicitDependent, expandedFrom, warnings);
+
+ @Nullable String unconvertedValue = parsedOption.getUnconvertedValue();
if (optionDefinition.isWrapperOption()) {
if (unconvertedValue.startsWith("-")) {
String sourceMessage =
@@ -414,11 +421,6 @@ class OptionsParserImpl {
+ ": "
+ Joiner.on(' ').join(unparsed));
}
- } else {
- OptionValueDescription entry =
- optionValues.computeIfAbsent(
- optionDefinition, OptionValueDescription::createOptionValueDescription);
- entry.addOptionInstance(parsedOption, implicitDependent, expandedFrom, warnings);
}
// Collect any implicit requirements.
