diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-10-09 13:21:21 +0300 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-10-09 13:21:21 +0300 |
commit | e1862cd36f147e410c003c9daee5fd2befdf9a42 (patch) | |
tree | d5e82ff17512fc3355721d7507614a99196e3280 /bin/uglifyjs2 | |
parent | 2c025f23db6efb6d1442208d81c2080d40c44f10 (diff) | |
download | tracifyjs-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-x | bin/uglifyjs2 | 10 |
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"); |