aboutsummaryrefslogtreecommitdiff
path: root/bin/uglifyjs2
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2012-10-09 13:21:21 +0300
committerMihai Bazon <mihai@bazon.net>2012-10-09 13:21:21 +0300
commite1862cd36f147e410c003c9daee5fd2befdf9a42 (patch)
treed5e82ff17512fc3355721d7507614a99196e3280 /bin/uglifyjs2
parent2c025f23db6efb6d1442208d81c2080d40c44f10 (diff)
downloadtracifyjs-e1862cd36f147e410c003c9daee5fd2befdf9a42.tar.gz
tracifyjs-e1862cd36f147e410c003c9daee5fd2befdf9a42.zip
add `--ast-help`
displays a rather cruel description of the AST classes, derived directly from the node definitions.
Diffstat (limited to 'bin/uglifyjs2')
-rwxr-xr-xbin/uglifyjs210
1 files changed, 8 insertions, 2 deletions
diff --git a/bin/uglifyjs2 b/bin/uglifyjs2
index b3b00a7b..8515586a 100755
--- a/bin/uglifyjs2
+++ b/bin/uglifyjs2
@@ -78,6 +78,14 @@ You need to pass an argument to this option to specify the name that your module
.argv
;
+normalize(ARGS);
+
+if (ARGS.ast_help) {
+ var desc = UglifyJS.describe_ast();
+ sys.puts(typeof desc == "string" ? desc : JSON.stringify(desc, null, 2));
+ process.exit(0);
+}
+
if (ARGS.h || ARGS.help) {
sys.puts(optimist.help());
process.exit(0);
@@ -87,8 +95,6 @@ if (ARGS.acorn) {
acorn = require("acorn");
}
-normalize(ARGS);
-
var COMPRESS = getOptions("c");
var MANGLE = getOptions("m");
var BEAUTIFY = getOptions("b");