8000 add '--no-color' option · websdotcom/less.js@041f119 · GitHub
[go: up one dir, main page]

Skip to content

Commit 041f119

Browse files
committed
add '--no-color' option
1 parent 8d9fc38 commit 041f119

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bin/lessc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ var options = {
1212
compress: false,
1313
optimization: 1,
1414
silent: false,
15-
paths: []
15+
paths: [],
16+
color: true
1617
};
1718

1819
args = args.filter(function (arg) {
@@ -46,6 +47,9 @@ args = args.filter(function (arg) {
4647
case 'compress':
4748
options.compress = true;
4849
break;
50+
case 'no-color':
51+
options.color = false;
52+
break;
4953
case 'include-path':
5054
A9C0 options.paths = match[2].split(':')
5155
.map(function(p) {

lib/less/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var less = {
3939
var message = "";
4040
var extract = ctx.extract;
4141
var error = [];
42+
var stylize = options.color ? less.stylize : function (str) { return str };
4243

4344
options = options || {};
4445

@@ -134,4 +135,5 @@ function stylize(str, style) {
134135
return '\033[' + styles[style][0] + 'm' + str +
135136
'\033[' + styles[style][1] + 'm';
136137
}
138+
less.stylize = stylize;
137139

0 commit comments

Comments
 (0)
0