mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Fix assertion failure in tab completion for --option
This commit is contained in:
parent
ff4dea63c9
commit
7f56cf67ba
2 changed files with 5 additions and 5 deletions
|
@ -44,7 +44,7 @@ MixCommonArgs::MixCommonArgs(const string & programName)
|
||||||
globalConfig.getSettings(settings);
|
globalConfig.getSettings(settings);
|
||||||
for (auto & s : settings)
|
for (auto & s : settings)
|
||||||
if (hasPrefix(s.first, prefix))
|
if (hasPrefix(s.first, prefix))
|
||||||
completions->add(s.first, s.second.description);
|
completions->add(s.first, fmt("Set the `%s` setting.", s.first));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -200,7 +200,7 @@ void BaseSetting<T>::convertToArg(Args & args, const std::string & category)
|
||||||
{
|
{
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = name,
|
.longName = name,
|
||||||
.description = description,
|
.description = fmt("Set the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.labels = {"value"},
|
.labels = {"value"},
|
||||||
.handler = {[=](std::string s) { overriden = true; set(s); }},
|
.handler = {[=](std::string s) { overriden = true; set(s); }},
|
||||||
|
@ -209,7 +209,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,
|
||||||
.description = description,
|
.description = fmt("Append to the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.labels = {"value"},
|
.labels = {"value"},
|
||||||
.handler = {[=](std::string s) { overriden = true; set(s, true); }},
|
.handler = {[=](std::string s) { overriden = true; set(s, true); }},
|
||||||
|
@ -260,13 +260,13 @@ template<> void BaseSetting<bool>::convertToArg(Args & args, const std::string &
|
||||||
{
|
{
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = name,
|
.longName = name,
|
||||||
.description = description,
|
.description = fmt("Enable the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.handler = {[=]() { override(true); }}
|
.handler = {[=]() { override(true); }}
|
||||||
});
|
});
|
||||||
args.addFlag({
|
args.addFlag({
|
||||||
.longName = "no-" + name,
|
.longName = "no-" + name,
|
||||||
.description = description,
|
.description = fmt("Disable the `%s` setting.", name),
|
||||||
.category = category,
|
.category = category,
|
||||||
.handler = {[=]() { override(false); }}
|
.handler = {[=]() { override(false); }}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue