Files
less.js/lib/less/lessc_helper.js
Matt fb21a897f6 Add some content to lessc help
Added some details to lessc and extracted a printUsage method.

Fixes #817
2012-08-15 18:53:35 +01:00

54 lines
2.2 KiB
JavaScript

// lessc_helper.js
//
// helper functions for lessc
sys = require('util');
var lessc_helper = {
//Stylize a string
stylize : function(str, style) {
var styles = {
'reset' : [0, 0],
'bold' : [1, 22],
'inverse' : [7, 27],
'underline' : [4, 24],
'yellow' : [33, 39],
'green' : [32, 39],
'red' : [31, 39],
'grey' : [90, 39]
};
return '\033[' + styles[style][0] + 'm' + str +
'\033[' + styles[style][1] + 'm';
},
//Print command line options
printUsage: function() {
sys.puts("usage: lessc [options] <source> [destination]");
sys.puts("");
sys.puts("If source is set to `-' (dash or hyphen-minus), input is read from stdin.");
sys.puts("");
sys.puts("options:");
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(" -s, --silent Suppress output of error messages.");
sys.puts(" --strict-imports Force evaluation of imports.");
sys.puts(" --verbose Be verbose.");
sys.puts(" -v, --version Print version number and exit.");
sys.puts(" -x, --compress Compress output by removing some whitespaces.");
sys.puts(" --yui-compress Compress output using cssmin.js.");
sys.puts(" -O0, -O1, -O2 Set the parser's optimization level. The lower");
sys.puts(" the number, the less nodes it will create in the");
sys.puts(" tree. This could matter for debugging, or if you");
sys.puts(" want to access the individual nodes in the tree.");
sys.puts("");
sys.puts("Report bugs to: http://github.com/cloudhead/less.js/issues");
sys.puts("Home page: <http://lesscss.org/>");
}
}
// Exports helper functions
for (var h in lessc_helper) { exports[h] = lessc_helper[h] }