1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 23:13:14 +02:00

Remove mkFlag()

This commit is contained in:
Eelco Dolstra 2021-01-27 12:06:03 +01:00
parent f15f0b8e83
commit 8e758d402b
7 changed files with 105 additions and 45 deletions

View file

@ -135,27 +135,6 @@ public:
void addFlag(Flag && flag);
/* Helper functions for constructing flags / positional
arguments. */
void mkFlag(char shortName, const std::string & name,
const std::string & description, bool * dest)
{
mkFlag(shortName, name, description, dest, true);
}
template<class T>
void mkFlag(char shortName, const std::string & longName, const std::string & description,
T * dest, const T & value)
{
addFlag({
.longName = longName,
.shortName = shortName,
.description = description,
.handler = {[=]() { *dest = value; }}
});
}
void expectArgs(ExpectedArg && arg)
{
expectedArgs.emplace_back(std::move(arg));