Commits

András Szabó committed 86195c9

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

  • Participants
  • Parent commits 4c54e62

Comments (0)

Files changed (1)

src/com/yahoo/platform/yui/compressor/YUICompressor.java

                 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()) {
                                 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);