From fb609901456f94b21ab63c5c2bad32bbb413baf2 Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Fri, 31 Aug 2012 14:10:02 +0100 Subject: [PATCH] Add a lint option to lessc --- bin/lessc | 7 ++++++- lib/less/lessc_helper.js | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/lessc b/bin/lessc index 31a6700b..34407658 100755 --- a/bin/lessc +++ b/bin/lessc @@ -12,6 +12,7 @@ var options = { yuicompress: false, optimization: 1, silent: false, + lint: false, paths: [], color: true, strictImports: false, @@ -48,6 +49,10 @@ args = args.filter(function (arg) { case 'silent': options.silent = true; break; + case 'l': + case 'lint': + options.lint = true; + break; case 'strict-imports': options.strictImports = true; break; @@ -149,7 +154,7 @@ var parseLessFile = function (e, data) { less.writeError(err, options); currentErrorcode = 1; return; - } else { + } else if(!options.lint) { try { var css = tree.toCSS({ compress: options.compress, diff --git a/lib/less/lessc_helper.js b/lib/less/lessc_helper.js index 1a82ef9a..1d028f26 100644 --- a/lib/less/lessc_helper.js +++ b/lib/less/lessc_helper.js @@ -31,6 +31,7 @@ var lessc_helper = { sys.puts(" -h, --help Print help (this message) and exit."); sys.puts(" --include-path Set include paths. Separated by `:'. Use `;' on Windows."); sys.puts(" --no-color Disable colorized output."); + sys.puts(" -l, --lint Syntax check only (lint)."); sys.puts(" -s, --silent Suppress output of error messages."); sys.puts(" --strict-imports Force evaluation of imports."); sys.puts(" --verbose Be verbose.");