aboutsummaryrefslogtreecommitdiff
path: root/bin/uglifyjs
diff options
context:
space:
mode:
authorBenoît Zugmeyer <bzugmeyer@gmail.com>2013-01-03 11:06:07 +0100
committerBenoît Zugmeyer <bzugmeyer@gmail.com>2013-01-03 11:07:53 +0100
commite82e89d1b05163c896de7ba66663c4a4a98067b9 (patch)
tree3d81c9fed64fe687274357b75a7c92a85e28da85 /bin/uglifyjs
parent83a4ebfedcd920871e583ef61151524b2d57b789 (diff)
downloadtracifyjs-e82e89d1b05163c896de7ba66663c4a4a98067b9.tar.gz
tracifyjs-e82e89d1b05163c896de7ba66663c4a4a98067b9.zip
--version option
Diffstat (limited to 'bin/uglifyjs')
-rwxr-xr-xbin/uglifyjs8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/uglifyjs b/bin/uglifyjs
index 1706629c..9eb1f316 100755
--- a/bin/uglifyjs
+++ b/bin/uglifyjs
@@ -49,6 +49,7 @@ You need to pass an argument to this option to specify the name that your module
.describe("export-all", "Only used when --wrap, this tells UglifyJS to add code to automatically export all globals.")
.describe("lint", "Display some scope warnings")
.describe("v", "Verbose")
+ .describe("V", "Print version number and exit.")
.alias("p", "prefix")
.alias("o", "output")
@@ -58,6 +59,7 @@ You need to pass an argument to this option to specify the name that your module
.alias("c", "compress")
.alias("d", "define")
.alias("r", "reserved")
+ .alias("V", "version")
.string("source-map")
.string("source-map-root")
@@ -82,6 +84,12 @@ You need to pass an argument to this option to specify the name that your module
normalize(ARGS);
+if (ARGS.version || ARGS.V) {
+ var json = require("../package.json");
+ sys.puts(json.name + ' ' + json.version);
+ process.exit(0);
+}
+
if (ARGS.ast_help) {
var desc = UglifyJS.describe_ast();
sys.puts(typeof desc == "string" ? desc : JSON.stringify(desc, null, 2));