Enable lint and it's output for cli
authorNikolay Slyunkov <nslyunkov@contractor.ea.com>
Tue, 11 Nov 2014 15:26:46 +0000 (19:26 +0400)
committerNikolay Slyunkov <nslyunkov@contractor.ea.com>
Tue, 11 Nov 2014 15:26:46 +0000 (19:26 +0400)
cli.js
src/htmlminifier.js

diff --git a/cli.js b/cli.js
index 7213335..84a1fbe 100755 (executable)
--- a/cli.js
+++ b/cli.js
@@ -34,6 +34,7 @@ var fs = require('fs');
 var appName = require('./package.json').name;
 var appVersion = require('./package.json').version;
 var minify = require('./dist/htmlminifier.min.js').minify;
+var HTMLLint = require('./dist/htmlminifier.min.js').HTMLLint;
 var minifyOptions = {};
 var input = null;
 var output = null;
@@ -127,6 +128,10 @@ cli.main(function(args, options) {
     }
   });
 
+  if (minifyOptions.lint === true) {
+    minifyOptions.lint = new HTMLLint();
+  }
+
   if (args.length) {
     input = args;
   }
index 5889363..59d16a9 100644 (file)
       customAttrSurround: options.customAttrSurround
     });
 
+    lint && lint.populate();
     results.push.apply(results, buffer);
     var str = joinResultSegments(results, options);
     log('minified in: ' + (new Date() - t) + 'ms');