Skip to content

Loading…

Parameter parsing fix (when compressing multiple files) #13

Merged
merged 1 commit into from

4 participants

@bandesz

Parameter parsing fix, when compressing multiple files, nomunge, preserve-semi and disable-optimizations options will be valid only for the first file

You will see that the parser.getOptionValue() calls were inside the while block, but in the second cycle these calls do not return with the same value as first time.

@bandesz bandesz Parameter parsing fix, when compressing multiple files, nomunge, pres…
…erve-semi and disable-optimizations options will be valid only for the first file
86195c9
@fruju

I'd like to see this included as well. This is an obvious bug which makes it very difficult to use any options with the multiple file filter version.

@tml tml merged commit 0617be6 into yui:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 2, 2011
  1. @bandesz

    Parameter parsing fix, when compressing multiple files, nomunge, pres…

    bandesz committed
    …erve-semi and disable-optimizations options will be valid only for the first file
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/com/yahoo/platform/yui/compressor/YUICompressor.java
View
8 src/com/yahoo/platform/yui/compressor/YUICompressor.java
@@ -78,6 +78,10 @@ public static void main(String args[]) {
System.exit(1);
}
+ boolean munge = parser.getOptionValue(nomungeOpt) == null;
+ boolean preserveAllSemiColons = parser.getOptionValue(preserveSemiOpt) != null;
+ boolean disableOptimizations = parser.getOptionValue(disableOptimizationsOpt) != null;
+
String[] fileArgs = parser.getRemainingArgs();
java.util.List files = java.util.Arrays.asList(fileArgs);
if (files.isEmpty()) {
@@ -165,10 +169,6 @@ public EvaluatorException runtimeError(String message, String sourceName,
out = new OutputStreamWriter(new FileOutputStream(outputFilename), charset);
}
- boolean munge = parser.getOptionValue(nomungeOpt) == null;
- boolean preserveAllSemiColons = parser.getOptionValue(preserveSemiOpt) != null;
- boolean disableOptimizations = parser.getOptionValue(disableOptimizationsOpt) != null;
-
compressor.compress(out, linebreakpos, munge, verbose,
preserveAllSemiColons, disableOptimizations);
Something went wrong with that request. Please try again.