From 4c77fa33a3082d612ed80fb43ee1d1fd7f64f363 Mon Sep 17 00:00:00 2001 From: abarre Date: Fri, 19 Jul 2013 14:34:15 +0200 Subject: [PATCH] Add option -s --skip-import --- bin/cleancss | 5 ++++- test/binary-test.js | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/cleancss b/bin/cleancss index 5c34c0ba..ba8df430 100755 --- a/bin/cleancss +++ b/bin/cleancss @@ -21,7 +21,8 @@ commands .option('--s0', 'Remove all special comments (i.e. /*! special comment */)') .option('--s1', 'Remove all special comments but the first one') .option('-r, --root [root-path]', 'Set a root path to which resolve absolute @import rules') - .option('-o, --output [output-file]', 'Use [output-file] as output instead of stdout'); + .option('-o, --output [output-file]', 'Use [output-file] as output instead of stdout') + .option('-s, --skip-import', 'Disable the @import processing'); commands.on('--help', function() { util.puts(' Examples:\n'); @@ -65,6 +66,8 @@ if (commands.s0) cleanOptions.keepSpecialComments = 0; if (commands.root) cleanOptions.root = commands.root; +if (commands.skipImport) + cleanOptions.processImport = false; if (commands.args.length > 0) { var source = commands.args[0]; options.source = source; diff --git a/test/binary-test.js b/test/binary-test.js index 0684aa37..ca965c7a 100644 --- a/test/binary-test.js +++ b/test/binary-test.js @@ -109,5 +109,10 @@ exports.commandsSuite = vows.describe('binary commands').addBatch({ else exec('rm ./reset-min.css'); } + }), + 'disable @import': binaryContext('-s ./test/data/imports.css', { + 'should disable the import processing': function(error, stdout) { + assert.equal(stdout, "@import url(./partials/one.css);@import url(./partials/two.css);.imports{color:#000}"); + } }) }); -- 2.34.1