Ugly hack to allow --argstr values starting with a dash

Fixes #265.
This commit is contained in:
Eelco Dolstra 2014-05-23 14:43:55 +02:00
parent 3064a82156
commit 0321ef9bb2

View file

@ -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);
}