Bläddra i källkod

Merge pull request #15225 from ghalliday/issue26319

HPCC-26319 Support --option+ and --option- for eclcc compatibility

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 år sedan
förälder
incheckning
c4bbcf1d89
1 ändrade filer med 14 tillägg och 2 borttagningar
  1. 14 2
      system/jlib/jptree.cpp

+ 14 - 2
system/jlib/jptree.cpp

@@ -8485,8 +8485,20 @@ static void applyCommandLineOption(IPropertyTree * config, const char * option,
     }
     else
     {
-        //MORE: Support --x- and --x+?
-        val = "1";
+        unsigned len = strlen(option);
+        if (len == 0)
+            return;
+
+        //support --option+ as --option=1 and --option- as --option=0 for eclcc compatibility
+        char last = option[len-1];
+        if ((last == '+') || (last == '-'))
+        {
+            name.append(len-1, option);
+            option = name;
+            val = (last == '+') ? "1" : "0";
+        }
+        else
+            val = "1";
     }
     if (stdContains(ignoreOptions, option))
         return;