@@ -24,34 +24,35 @@ module.exports = function(less) {
24
24
var cleanOptionArgs = options . split ( " " ) ;
25
25
options = { } ;
26
26
for ( var i = 0 ; i < cleanOptionArgs . length ; i ++ ) {
27
- var argSplit = cleanOptionArgs [ i ] . split ( "=" ) ;
28
- switch ( argSplit [ 0 ] ) {
29
- case "--keep-line-breaks" :
30
- case "-b" :
27
+ var argSplit = cleanOptionArgs [ i ] . split ( "=" ) ,
28
+ argName = argSplit [ 0 ] . replace ( / ^ - + / , "" ) ;
29
+ switch ( argName ) {
30
+ case "keep-line-breaks" :
31
+ case "b" :
31
32
options . keepBreaks = true ;
32
33
break ;
33
- case "-- s0" :
34
+ case "s0" :
34
35
options . keepSpecialComments = 0 ;
35
36
break ;
36
- case "-- s1" :
37
+ case "s1" :
37
38
options . keepSpecialComments = 1 ;
38
39
break ;
39
- case "-- skip-advanced" :
40
+ case "skip-advanced" :
40
41
options . noAdvanced = true ;
41
42
break ;
42
- case "-- advanced" :
43
+ case "advanced" :
43
44
options . noAdvanced = false ;
44
45
break ;
45
- case "-- compatibility" :
46
+ case "compatibility" :
46
47
options . compatibility = argSplit [ 1 ] ;
47
48
break ;
48
- case "-- rounding-precision" :
49
+ case "rounding-precision" :
49
50
options . roundingPrecision = Number ( argSplit [ 1 ] ) ;
50
51
break ;
51
52
default :
52
53
console . log ( "unrecognised clean-css option '" + argSplit [ 0 ] + "'" ) ;
53
- console . log ( "we support only arguments that make sense for less, '-- keep-line-breaks', '- b'" ) ;
54
- console . log ( "'-- s0', '-- s1', '-- advanced', '-- skip-advanced', '-- compatibility', '-- rounding-precision'" ) ;
54
+ console . log ( "we support only arguments that make sense for less, 'keep-line-breaks', 'b'" ) ;
55
+ console . log ( "'s0', 's1', 'advanced', 'skip-advanced', 'compatibility', 'rounding-precision'" ) ;
55
56
throw new Error ( ) ;
56
57
}
57
58
}
0 commit comments