1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-30 15:48:00 +02:00

nix: Respect -I, --arg, --argstr

Also, random cleanup to argument handling.
This commit is contained in:
Eelco Dolstra 2017-10-24 12:45:11 +02:00
parent 25f32625e2
commit 0d59f1ca49
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
26 changed files with 349 additions and 299 deletions

View file

@ -152,7 +152,7 @@ void BaseSetting<T>::convertToArg(Args & args, const std::string & category)
.longName(name)
.description(description)
.arity(1)
.handler([=](Strings ss) { set(*ss.begin()); })
.handler([=](std::vector<std::string> ss) { set(ss[0]); })
.category(category);
}
@ -201,12 +201,12 @@ template<> void BaseSetting<bool>::convertToArg(Args & args, const std::string &
args.mkFlag()
.longName(name)
.description(description)
.handler([=](Strings ss) { value = true; })
.handler([=](std::vector<std::string> ss) { value = true; })
.category(category);
args.mkFlag()
.longName("no-" + name)
.description(description)
.handler([=](Strings ss) { value = false; })
.handler([=](std::vector<std::string> ss) { value = false; })
.category(category);
}