fix minifyURLs in command-line usage
authoralexlamsl <alexlamsl@gmail.com>
Sun, 7 Feb 2016 08:29:16 +0000 (16:29 +0800)
committeralexlamsl <alexlamsl@gmail.com>
Sun, 7 Feb 2016 08:29:16 +0000 (16:29 +0800)
since it is defined as a boolean parameter, this option never worked

cli.js

diff --git a/cli.js b/cli.js
index 2c18e90..fad4062 100755 (executable)
--- a/cli.js
+++ b/cli.js
@@ -80,7 +80,7 @@ var mainOptions = {
   caseSensitive: [[false, 'Treat attributes in case sensitive manner (useful for SVG; e.g. viewBox)']],
   minifyJS: [[false, 'Minify Javascript in script elements and on* attributes (uses UglifyJS)']],
   minifyCSS: [[false, 'Minify CSS in style elements and style attributes (uses clean-css)']],
-  minifyURLs: [[false, 'Minify URLs in various attributes (uses relateurl)']],
+  minifyURLs: [[false, 'Minify URLs in various attributes (uses relateurl)', 'string'], 'site-url'],
   ignoreCustomComments: [[false, 'Array of regex\'es that allow to ignore certain comments, when matched', 'string'], 'json-regex'],
   ignoreCustomFragments: [[false, 'Array of regex\'es that allow to ignore certain fragments, when matched (e.g. <?php ... ?>, {{ ... }})', 'string'], 'json-regex'],
   processScripts: [[false, 'Array of strings corresponding to types of script elements to process through minifier (e.g. "text/ng-template", "text/x-handlebars-template", etc.)', 'string'], 'json'],
@@ -274,6 +274,9 @@ cli.main(function(args, options) {
         case 'string-regex':
           minifyOptions[key] = stringToRegExp(value);
           break;
+        case 'site-url':
+          minifyOptions[key] = { site: value };
+          break;
         case true:
           minifyOptions[key] = value;
           break;