Add --materialize_param_files option.

When set, any action parameter files are written locally upon action execution, even when the action is executed remotely. This is mainly useful for debugging.

This option is effectively implied by --subcommands and --verbose_failures, as it is likely that the user is debugging actions when using these flags.

RELNOTES: Add --materialize_param_files flag to write parameter files even when actions are executed remotely.
PiperOrigin-RevId: 201225566
diff --git a/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java b/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java
index 9f9e335..ec006b9 100644
--- a/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java
@@ -49,6 +49,16 @@
   public static final ExecutionOptions DEFAULTS = Options.getDefaults(ExecutionOptions.class);
 
   @Option(
+      name = "materialize_param_files",
+      defaultValue = "false",
+      documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+      effectTags = {OptionEffectTag.UNKNOWN},
+      help =
+          "Writes intermediate parameter files to output tree even when using "
+              + "remote action execution. Useful when debugging actions. ")
+  public boolean materializeParamFiles;
+
+  @Option(
     name = "verbose_failures",
     defaultValue = "false",
     documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,