mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
addFlag: use aliases
This commit is contained in:
parent
8ce4287409
commit
74dccef004
3 changed files with 7 additions and 0 deletions
|
@ -304,18 +304,21 @@ template<> void BaseSetting<SandboxMode>::convertToArg(Args & args, const std::s
|
||||||
{
|
{
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = name,
|
.longName = name,
|
||||||
|
.aliases = aliases,
|
||||||
.description = "Enable sandboxing.",
|
.description = "Enable sandboxing.",
|
||||||
.category = category,
|
.category = category,
|
||||||
.handler = {[this]() { override(smEnabled); }}
|
.handler = {[this]() { override(smEnabled); }}
|
||||||
});
|
});
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = "no-" + name,
|
.longName = "no-" + name,
|
||||||
|
.aliases = aliases,
|
||||||
.description = "Disable sandboxing.",
|
.description = "Disable sandboxing.",
|
||||||
.category = category,
|
.category = category,
|
||||||
.handler = {[this]() { override(smDisabled); }}
|
.handler = {[this]() { override(smDisabled); }}
|
||||||
});
|
});
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = "relaxed-" + name,
|
.longName = "relaxed-" + name,
|
||||||
|
.aliases = aliases,
|
||||||
.description = "Enable sandboxing, but allow builds to disable it.",
|
.description = "Enable sandboxing, but allow builds to disable it.",
|
||||||
.category = category,
|
.category = category,
|
||||||
.handler = {[this]() { override(smRelaxed); }}
|
.handler = {[this]() { override(smRelaxed); }}
|
||||||
|
|
|
@ -81,6 +81,7 @@ void BaseSetting<T>::convertToArg(Args & args, const std::string & category)
|
||||||
{
|
{
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = name,
|
.longName = name,
|
||||||
|
.aliases = aliases,
|
||||||
.description = fmt("Set the `%s` setting.", name),
|
.description = fmt("Set the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.labels = {"value"},
|
.labels = {"value"},
|
||||||
|
@ -91,6 +92,7 @@ void BaseSetting<T>::convertToArg(Args & args, const std::string & category)
|
||||||
if (isAppendable())
|
if (isAppendable())
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = "extra-" + name,
|
.longName = "extra-" + name,
|
||||||
|
.aliases = aliases,
|
||||||
.description = fmt("Append to the `%s` setting.", name),
|
.description = fmt("Append to the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.labels = {"value"},
|
.labels = {"value"},
|
||||||
|
|
|
@ -292,6 +292,7 @@ template<> void BaseSetting<bool>::convertToArg(Args & args, const std::string &
|
||||||
{
|
{
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = name,
|
.longName = name,
|
||||||
|
.aliases = aliases,
|
||||||
.description = fmt("Enable the `%s` setting.", name),
|
.description = fmt("Enable the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.handler = {[this] { override(true); }},
|
.handler = {[this] { override(true); }},
|
||||||
|
@ -299,6 +300,7 @@ template<> void BaseSetting<bool>::convertToArg(Args & args, const std::string &
|
||||||
});
|
});
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = "no-" + name,
|
.longName = "no-" + name,
|
||||||
|
.aliases = aliases,
|
||||||
.description = fmt("Disable the `%s` setting.", name),
|
.description = fmt("Disable the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.handler = {[this] { override(false); }},
|
.handler = {[this] { override(false); }},
|
||||||
|
|
Loading…
Reference in a new issue