about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-05-23T12·43+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-05-23T12·43+0200
commit0321ef9bb261958fe4d63210e9a9d3350737ef18 (patch)
tree59513f4c03cc4d26ade0f711493111ab5967bb11
parent3064a8215608eca391fcb9d492735a662f48242e (diff)
Ugly hack to allow --argstr values starting with a dash
Fixes #265.
-rw-r--r--src/libmain/shared.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index a390654452ed..14263446fe2e 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -220,6 +220,13 @@ static void initAndRun(int argc, char * * argv)
             string value = *i;
             settings.set(name, value);
         }
+        else if (arg == "--arg" || arg == "--argstr") {
+            remaining.push_back(arg);
+            ++i; if (i == args.end()) throw UsageError(format("`%1%' requires two arguments") % arg);
+            remaining.push_back(*i);
+            ++i; if (i == args.end()) throw UsageError(format("`%1%' requires two arguments") % arg);
+            remaining.push_back(*i);
+        }
         else remaining.push_back(arg);
     }