aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-09-11 20:03:02 +0200
committerGravatar Philipp Wollermann <philwo@google.com>2017-09-12 14:05:08 +0200
commit1dce09721f8361240bbf056fd508f1ac5fdcfd32 (patch)
tree2406d3ab794db15d509adc842121bfa9f6c6eb84 /src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
parent5a77f426e0896031973ce1dc965f05e014ee9a24 (diff)
Replace referrals to options by their name to option definitions.
Now that we have a standard way of referring to an option, remove all of the places that we were referring to them by their name. Since options can have multiple names, this is more clear and provides the additional information needed to understand the option. It also stops the habit of requesting unqualified strings, which was hard to read. RELNOTES: None. PiperOrigin-RevId: 168254584
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
index ea430730f8..df97889f53 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcher.java
@@ -14,7 +14,6 @@
package com.google.devtools.build.lib.runtime;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.base.Predicates;
import com.google.common.base.Throwables;
@@ -51,6 +50,7 @@ import com.google.devtools.build.lib.vfs.FileSystemUtils;
import com.google.devtools.build.lib.vfs.Path;
import com.google.devtools.common.options.InvocationPolicyEnforcer;
import com.google.devtools.common.options.OpaqueOptionsData;
+import com.google.devtools.common.options.OptionDefinition;
import com.google.devtools.common.options.OptionPriority;
import com.google.devtools.common.options.OptionsParser;
import com.google.devtools.common.options.OptionsParsingException;
@@ -68,6 +68,7 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
+import java.util.function.Function;
import java.util.logging.Level;
import javax.annotation.Nullable;
@@ -207,9 +208,9 @@ public class BlazeCommandDispatcher {
OptionsParser optionsParser, Command commandAnnotation, List<String> args,
List<String> rcfileNotes, ExtendedEventHandler eventHandler)
throws OptionsParsingException {
- Function<String, String> commandOptionSourceFunction =
- input -> {
- if (INTERNAL_COMMAND_OPTIONS.contains(input)) {
+ Function<OptionDefinition, String> commandOptionSourceFunction =
+ option -> {
+ if (INTERNAL_COMMAND_OPTIONS.contains(option.getOptionName())) {
return "options generated by " + runtime.getProductName() + " launcher";
} else {
return "command line options";