From: alexlamsl Date: Sun, 7 Feb 2016 08:29:16 +0000 (+0800) Subject: fix minifyURLs in command-line usage X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=8930858cd97ef4e76fde46f334dfb8cdc75c4f33;p=html-minifier.git fix minifyURLs in command-line usage since it is defined as a boolean parameter, this option never worked --- diff --git a/cli.js b/cli.js index 2c18e90..fad4062 100755 --- 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. , {{ ... }})', '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;