[Pkg-javascript-commits] [uglifyjs] 111/190: Allow cli options to be specified in separate definitions

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Aug 7 23:17:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to annotated tag upstream/2.7.0
in repository uglifyjs.

commit d5c651a5e5667e64f4fe76f4d3669ba5bd375b6d
Author: Richard van Velzen <rvanvelzen at experty.com>
Date:   Mon Feb 8 10:36:28 2016 +0100

    Allow cli options to be specified in separate definitions
    
    Fix for #963. This allows stuff like `--define a=1 --define b=1` besides only `--define a=1,b=1`
---
 bin/uglifyjs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/bin/uglifyjs b/bin/uglifyjs
index f7f2221..1f449aa 100755
--- a/bin/uglifyjs
+++ b/bin/uglifyjs
@@ -499,17 +499,19 @@ function normalize(o) {
     }
 }
 
-function getOptions(x, constants) {
-    x = ARGS[x];
+function getOptions(flag, constants) {
+    var x = ARGS[flag];
     if (x == null) return null;
     var ret = {};
     if (x !== "") {
+        if (Array.isArray(x)) x = x.map(function (v) { return "(" + v + ")"; }).join(", ");
+
         var ast;
         try {
             ast = UglifyJS.parse(x, { expression: true });
         } catch(ex) {
             if (ex instanceof UglifyJS.JS_Parse_Error) {
-                print_error("Error parsing arguments in: " + x);
+                print_error("Error parsing arguments for flag `" + flag + "': " + x);
                 process.exit(1);
             }
         }
@@ -529,7 +531,7 @@ function getOptions(x, constants) {
                 return true;    // no descend
             }
             print_error(node.TYPE)
-            print_error("Error parsing arguments in: " + x);
+            print_error("Error parsing arguments for flag `" + flag + "': " + x);
             process.exit(1);
         }));
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list