aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-01-25 19:03:13 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-01-25 19:03:13 +0100
commit36c4d6f59247826dde32ad2e6b5a9471a9a1c911 (patch)
treec07928e4554aaf6622cd1df996fd4fdc1c368f20 /src/libexpr
parent807d963ee8d23e88f09e28365b045d322530c5aa (diff)
Group common options
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/common-eval-args.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libexpr/common-eval-args.cc b/src/libexpr/common-eval-args.cc
index ffe782454..aa14bf79b 100644
--- a/src/libexpr/common-eval-args.cc
+++ b/src/libexpr/common-eval-args.cc
@@ -12,9 +12,12 @@ namespace nix {
MixEvalArgs::MixEvalArgs()
{
+ auto category = "Common evaluation options";
+
addFlag({
.longName = "arg",
.description = "Pass the value *expr* as the argument *name* to Nix functions.",
+ .category = category,
.labels = {"name", "expr"},
.handler = {[&](std::string name, std::string expr) { autoArgs[name] = 'E' + expr; }}
});
@@ -22,6 +25,7 @@ MixEvalArgs::MixEvalArgs()
addFlag({
.longName = "argstr",
.description = "Pass the string *string* as the argument *name* to Nix functions.",
+ .category = category,
.labels = {"name", "string"},
.handler = {[&](std::string name, std::string s) { autoArgs[name] = 'S' + s; }},
});
@@ -30,6 +34,7 @@ MixEvalArgs::MixEvalArgs()
.longName = "include",
.shortName = 'I',
.description = "Add *path* to the list of locations used to look up `<...>` file names.",
+ .category = category,
.labels = {"path"},
.handler = {[&](std::string s) { searchPath.push_back(s); }}
});
@@ -37,6 +42,7 @@ MixEvalArgs::MixEvalArgs()
addFlag({
.longName = "impure",
.description = "Allow access to mutable paths and repositories.",
+ .category = category,
.handler = {[&]() {
evalSettings.pureEval = false;
}},
@@ -45,6 +51,7 @@ MixEvalArgs::MixEvalArgs()
addFlag({
.longName = "override-flake",
.description = "Override the flake registries, redirecting *original-ref* to *resolved-ref*.",
+ .category = category,
.labels = {"original-ref", "resolved-ref"},
.handler = {[&](std::string _from, std::string _to) {
auto from = parseFlakeRef(_from, absPath("."));