Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tree option

  • Loading branch information...
commit 8ccb6c6a1403abb2662950a24785171bee98600c 1 parent 5401a9f
@mafintosh authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 cli.js
View
12 cli.js
@@ -15,8 +15,20 @@ if (!fs.existsSync(filename)) {
process.exit(2);
}
+var tree = process.argv.indexOf('--tree') > -1 || process.argv.indexOf('-t') > -1;
+
filename = fs.realpathSync(filename);
+if (tree) {
+ pejs.tree(filename, function(err, tree) {
+ if (err) {
+ console.error(err.message);
+ process.exit(3);
+ }
+ console.log(JSON.stringify(tree));
+ });
+}
+
pejs.parse(filename, function(err, src) {
if (err) {
console.error(err.message);
Please sign in to comment.
Something went wrong with that request. Please try again.