diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-07-17T17·02+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-07-20T11·33+0200 |
commit | 90825dea518ea078f0783a72cc471a5b3716d198 (patch) | |
tree | b6f6fed6e8c7a96a6769344060409f19a56290b9 /src/libutil/args.hh | |
parent | 3162ad5ff497b92fc25cd3f397eaff01d67340cc (diff) |
Add "nix search" command
Diffstat (limited to 'src/libutil/args.hh')
-rw-r--r-- | src/libutil/args.hh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/args.hh b/src/libutil/args.hh index ef8a7953e520..37e780dd1748 100644 --- a/src/libutil/args.hh +++ b/src/libutil/args.hh @@ -164,9 +164,9 @@ public: } /* Expect a string argument. */ - void expectArg(const std::string & label, string * dest) + void expectArg(const std::string & label, string * dest, bool optional = false) { - expectedArgs.push_back(ExpectedArg{label, 1, false, [=](Strings ss) { + expectedArgs.push_back(ExpectedArg{label, 1, optional, [=](Strings ss) { *dest = ss.front(); }}); } |