Permalink
Browse files

Implement --debug.

  • Loading branch information...
1 parent 96b953b commit 0e4c6605d68efac6d23649c1cf99e15acb27d70e @rstacruz committed Sep 4, 2012
Showing with 4 additions and 0 deletions.
  1. +1 −0 bin/cssc
  2. +3 −0 index.js
View
@@ -21,6 +21,7 @@ function getOptions() {
.option("--no-compress", "Don't strip whitespaces from output")
.option("--no-sort", "Turn off sorting")
.option("--line-breaks", "Add linebreaks")
+ .option("--debug", "Debug mode")
.option("-S, --safe", "Don't do unsafe operations")
.on('--help', function() {
console.log(" The --no-sort switch turns off all sorting (ie, it implies --no-sort-*).");
View
@@ -68,6 +68,9 @@ function compress(str, options) {
//- Combine the bang comments with the stringified output.
output = parts.comments.join("") + output;
+ //- Debug mode? Add comments at the beginning
+ output = "/* Transformed AST:\n" + JSON.stringify(tree, null, 2) + "\n*/\n";
+
return output;
}

0 comments on commit 0e4c660

Please sign in to comment.