From fb21a897f6472da3d739fc9d7be4683da71e49ff Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 15 Aug 2012 14:26:07 +1200 Subject: [PATCH] Add some content to lessc help Added some details to lessc and extracted a printUsage method. Fixes #817 --- bin/lessc | 2 +- lib/less/lessc_helper.js | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/bin/lessc b/bin/lessc index 69d4f730..8e4733d2 100755 --- a/bin/lessc +++ b/bin/lessc @@ -45,7 +45,7 @@ args = args.filter(function (arg) { break; case 'h': case 'help': - sys.puts("usage: lessc source [destination]"); + require('../lib/less/lessc_helper').printUsage(); process.exit(0); case 'x': case 'compress': diff --git a/lib/less/lessc_helper.js b/lib/less/lessc_helper.js index cf0ec63f..75df00bd 100644 --- a/lib/less/lessc_helper.js +++ b/lib/less/lessc_helper.js @@ -1,6 +1,7 @@ // lessc_helper.js // // helper functions for lessc +sys = require('util'); var lessc_helper = { @@ -18,8 +19,34 @@ var lessc_helper = { }; return '\033[' + styles[style][0] + 'm' + str + '\033[' + styles[style][1] + 'm'; + }, + + //Print command line options + printUsage: function() { + sys.puts("usage: lessc [options] [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: "); } + } // Exports helper functions