diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-28 18:21:44 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-28 18:21:44 +0800 |
commit | c6c9f4f5a837bea16609b1d430e6c20687f3742b (patch) | |
tree | ceeb632bde5e54dd6c0acb7dafa2ccd3e57ac1e4 /bin | |
parent | fec14379f6bae209484d75ba1db5c6b5ee37ae5a (diff) | |
download | tracifyjs-c6c9f4f5a837bea16609b1d430e6c20687f3742b.tar.gz tracifyjs-c6c9f4f5a837bea16609b1d430e6c20687f3742b.zip |
implement `--help options` (#2017)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/uglifyjs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/uglifyjs b/bin/uglifyjs index 158dc571..b9406e1c 100755 --- a/bin/uglifyjs +++ b/bin/uglifyjs @@ -25,6 +25,18 @@ program.version(info.name + ' ' + info.version); program.parseArgv = program.parse; program.parse = undefined; if (process.argv.indexOf("ast") >= 0) program.helpInformation = UglifyJS.describe_ast; +else if (process.argv.indexOf("options") >= 0) program.helpInformation = function() { + var text = []; + var options = UglifyJS.default_options(); + for (var option in options) { + text.push("--" + (option == "output" ? "beautify" : option == "sourceMap" ? "source-map" : option) + " options:"); + Object.keys(options[option]).forEach(function(name) { + text.push(" " + name); + }); + text.push(""); + } + return text.join("\n"); +}; program.option("-p, --parse <options>", "Specify parser options.", parse_js("parse", true)); program.option("-c, --compress [options]", "Enable compressor/specify compressor options.", parse_js("compress", true)); program.option("-m, --mangle [options]", "Mangle names/specify mangler options.", parse_js("mangle", true)); |