mirror of
https://github.com/NixOS/nix
synced 2025-06-29 23:13:14 +02:00
parent
38374a9d35
commit
112ff7833d
4 changed files with 14 additions and 10 deletions
|
@ -51,6 +51,7 @@ protected:
|
|||
{
|
||||
std::string label;
|
||||
size_t arity; // 0 = any
|
||||
bool optional;
|
||||
std::function<void(Strings)> handler;
|
||||
};
|
||||
|
||||
|
@ -165,7 +166,7 @@ public:
|
|||
/* Expect a string argument. */
|
||||
void expectArg(const std::string & label, string * dest)
|
||||
{
|
||||
expectedArgs.push_back(ExpectedArg{label, 1, [=](Strings ss) {
|
||||
expectedArgs.push_back(ExpectedArg{label, 1, false, [=](Strings ss) {
|
||||
*dest = ss.front();
|
||||
}});
|
||||
}
|
||||
|
@ -173,7 +174,7 @@ public:
|
|||
/* Expect 0 or more arguments. */
|
||||
void expectArgs(const std::string & label, Strings * dest)
|
||||
{
|
||||
expectedArgs.push_back(ExpectedArg{label, 0, [=](Strings ss) {
|
||||
expectedArgs.push_back(ExpectedArg{label, 0, false, [=](Strings ss) {
|
||||
*dest = ss;
|
||||
}});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue