mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 23:42:43 +01:00
Add reason string support to MissingExperimentalFeature
This commit is contained in:
parent
583f5e37fc
commit
0fd890a8d6
4 changed files with 9 additions and 7 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#include "nix/util/experimental-features.hh"
|
||||
#include "nix/util/fmt.hh"
|
||||
#include "nix/util/strings.hh"
|
||||
#include "nix/util/util.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
|
@ -376,10 +377,11 @@ std::set<ExperimentalFeature> parseFeatures(const StringSet & rawFeatures)
|
|||
return res;
|
||||
}
|
||||
|
||||
MissingExperimentalFeature::MissingExperimentalFeature(ExperimentalFeature feature)
|
||||
MissingExperimentalFeature::MissingExperimentalFeature(ExperimentalFeature feature, std::string reason)
|
||||
: Error(
|
||||
"experimental Nix feature '%1%' is disabled; add '--extra-experimental-features %1%' to enable it",
|
||||
showExperimentalFeature(feature))
|
||||
"experimental Nix feature '%1%' is disabled%2%; add '--extra-experimental-features %1%' to enable it",
|
||||
showExperimentalFeature(feature),
|
||||
Uncolored(optionalBracket(" (", reason, ")")))
|
||||
, missingFeature(feature)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue