forked from lix-project/lix
Propagate flags like --sandbox to the daemon properly
This commit is contained in:
parent
7536fe31dd
commit
6cdaa858d0
|
@ -116,17 +116,17 @@ template<> void BaseSetting<SandboxMode>::convertToArg(Args & args, const std::s
|
||||||
args.mkFlag()
|
args.mkFlag()
|
||||||
.longName(name)
|
.longName(name)
|
||||||
.description("Enable sandboxing.")
|
.description("Enable sandboxing.")
|
||||||
.handler([=](std::vector<std::string> ss) { value = smEnabled; })
|
.handler([=](std::vector<std::string> ss) { override(smEnabled); })
|
||||||
.category(category);
|
.category(category);
|
||||||
args.mkFlag()
|
args.mkFlag()
|
||||||
.longName("no-" + name)
|
.longName("no-" + name)
|
||||||
.description("Disable sandboxing.")
|
.description("Disable sandboxing.")
|
||||||
.handler([=](std::vector<std::string> ss) { value = smDisabled; })
|
.handler([=](std::vector<std::string> ss) { override(smDisabled); })
|
||||||
.category(category);
|
.category(category);
|
||||||
args.mkFlag()
|
args.mkFlag()
|
||||||
.longName("relaxed-" + name)
|
.longName("relaxed-" + name)
|
||||||
.description("Enable sandboxing, but allow builds to disable it.")
|
.description("Enable sandboxing, but allow builds to disable it.")
|
||||||
.handler([=](std::vector<std::string> ss) { value = smRelaxed; })
|
.handler([=](std::vector<std::string> ss) { override(smRelaxed); })
|
||||||
.category(category);
|
.category(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ void BaseSetting<T>::convertToArg(Args & args, const std::string & category)
|
||||||
.longName(name)
|
.longName(name)
|
||||||
.description(description)
|
.description(description)
|
||||||
.arity(1)
|
.arity(1)
|
||||||
.handler([=](std::vector<std::string> ss) { set(ss[0]); })
|
.handler([=](std::vector<std::string> ss) { overriden = true; set(ss[0]); })
|
||||||
.category(category);
|
.category(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,12 +201,12 @@ template<> void BaseSetting<bool>::convertToArg(Args & args, const std::string &
|
||||||
args.mkFlag()
|
args.mkFlag()
|
||||||
.longName(name)
|
.longName(name)
|
||||||
.description(description)
|
.description(description)
|
||||||
.handler([=](std::vector<std::string> ss) { value = true; })
|
.handler([=](std::vector<std::string> ss) { override(true); })
|
||||||
.category(category);
|
.category(category);
|
||||||
args.mkFlag()
|
args.mkFlag()
|
||||||
.longName("no-" + name)
|
.longName("no-" + name)
|
||||||
.description(description)
|
.description(description)
|
||||||
.handler([=](std::vector<std::string> ss) { value = false; })
|
.handler([=](std::vector<std::string> ss) { override(false); })
|
||||||
.category(category);
|
.category(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,12 @@ public:
|
||||||
|
|
||||||
void set(const std::string & str) override;
|
void set(const std::string & str) override;
|
||||||
|
|
||||||
|
virtual void override(const T & v)
|
||||||
|
{
|
||||||
|
overriden = true;
|
||||||
|
value = v;
|
||||||
|
}
|
||||||
|
|
||||||
std::string to_string() override;
|
std::string to_string() override;
|
||||||
|
|
||||||
void convertToArg(Args & args, const std::string & category) override;
|
void convertToArg(Args & args, const std::string & category) override;
|
||||||
|
|
Loading…
Reference in a new issue