From 0321ef9bb261958fe4d63210e9a9d3350737ef18 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 23 May 2014 14:43:55 +0200 Subject: [PATCH] Ugly hack to allow --argstr values starting with a dash Fixes #265. --- src/libmain/shared.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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); }