mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Add "nix add-to-store" command
This commit is contained in:
parent
1c58ad2ffa
commit
970366266b
4 changed files with 67 additions and 4 deletions
|
@ -81,15 +81,16 @@ public:
|
|||
FlagMaker & handler(std::function<void(Strings)> handler) { flag->handler = handler; return *this; };
|
||||
FlagMaker & category(const std::string & s) { flag->category = s; return *this; };
|
||||
|
||||
FlagMaker & dest(std::string * dest) {
|
||||
assert(flag->arity == 1);
|
||||
template<class T>
|
||||
FlagMaker & dest(T * dest) {
|
||||
flag->arity = 1;
|
||||
flag->handler = [=](Strings ss) { *dest = ss.front(); };
|
||||
return *this;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
FlagMaker & set(T * dest, const T & val) {
|
||||
assert(flag->arity == 0);
|
||||
flag->arity = 1;
|
||||
flag->handler = [=](Strings ss) { *dest = val; };
|
||||
return *this;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue