1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 08:11:47 +02:00

* Option --argstr for passing string arguments easily. (NIX-75)

This commit is contained in:
Eelco Dolstra 2007-01-14 12:32:44 +00:00
parent 4e329f173f
commit e418976107
11 changed files with 88 additions and 28 deletions

View file

@ -10,6 +10,7 @@
#include "expr-to-xml.hh"
#include "util.hh"
#include "store-api.hh"
#include "common-opts.hh"
#include "help.txt.hh"
@ -112,15 +113,8 @@ void run(Strings args)
throw UsageError("`--attr' requires an argument");
attrPaths.push_back(*i++);
}
else if (arg == "--arg") {
if (i == args.end())
throw UsageError("`--arg' requires two arguments");
string name = *i++;
if (i == args.end())
throw UsageError("`--arg' requires two arguments");
Expr value = parseExprFromString(state, *i++, absPath("."));
autoArgs.set(toATerm(name), value);
}
else if (parseOptionArg(arg, i, args.end(), state, autoArgs))
;
else if (arg == "--add-root") {
if (i == args.end())
throw UsageError("`--add-root' requires an argument");