aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/common/options/OptionsParser.java
diff options
context:
space:
mode:
authorGravatar apell <apell@google.com>2017-09-20 22:02:20 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-09-21 11:04:06 +0200
commitbcb3c5798390d6901681e74e19099378a9afae0a (patch)
treed8f7fb229f0d2e3bcbb8a6c2bf268e85d8493f78 /src/main/java/com/google/devtools/common/options/OptionsParser.java
parentdc176903da9e84680a1cb2d19b469562e76e570f (diff)
Create multiple ParamsFilePreProcessors to allow parsing files using the formats specified in ParameterFile.ParameterFileType. Also maintain the currently used parsing style of whitespace split arguments that allows single and double quoting and whitespace and quote escaping. This style of parsing is for a format not currently generated and will be removed once all consuming actions have been converted to using a supported format explicitly.
RELNOTES: None. PiperOrigin-RevId: 169437362
Diffstat (limited to 'src/main/java/com/google/devtools/common/options/OptionsParser.java')
-rw-r--r--src/main/java/com/google/devtools/common/options/OptionsParser.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/common/options/OptionsParser.java b/src/main/java/com/google/devtools/common/options/OptionsParser.java
index 3e6b5ccba8..28c2206fbc 100644
--- a/src/main/java/com/google/devtools/common/options/OptionsParser.java
+++ b/src/main/java/com/google/devtools/common/options/OptionsParser.java
@@ -200,9 +200,16 @@ public class OptionsParser implements OptionsProvider {
this.impl.setAllowSingleDashLongOptions(allowSingleDashLongOptions);
}
- /** Enables the Parser to handle params files loacted insinde the provided {@link FileSystem}. */
+ /** Enables the Parser to handle params files located inside the provided {@link FileSystem}. */
public void enableParamsFileSupport(FileSystem fs) {
- this.impl.setArgsPreProcessor(new ParamsFilePreProcessor(fs));
+ enableParamsFileSupport(new LegacyParamsFilePreProcessor(fs));
+ }
+
+ /**
+ * Enables the Parser to handle params files using the provided {@link ParamsFilePreProcessor}.
+ */
+ public void enableParamsFileSupport(ParamsFilePreProcessor preProcessor) {
+ this.impl.setArgsPreProcessor(preProcessor);
}
public void parseAndExitUponError(String[] args) {