aboutsummaryrefslogtreecommitdiff
path: root/src/libmain
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-05-23 14:43:55 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-05-23 14:43:58 +0200
commit0321ef9bb261958fe4d63210e9a9d3350737ef18 (patch)
tree59513f4c03cc4d26ade0f711493111ab5967bb11 /src/libmain
parent3064a8215608eca391fcb9d492735a662f48242e (diff)
Ugly hack to allow --argstr values starting with a dash
Fixes #265.
Diffstat (limited to 'src/libmain')
-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 a39065445..14263446f 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);
}