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
1 changed files with 7 additions and 0 deletions

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