1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-10-18 00:16:11 -04:00
This commit is contained in:
Silvan Mosberger 2024-10-16 20:27:01 +02:00 committed by GitHub
commit c4fb59e1d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,7 +24,7 @@ static Path gcRoot;
static int rootNr = 0;
enum OutputKind { okPlain, okXML, okJSON };
enum OutputKind { okPlain, okXML, okJSON, okRaw };
void processExpr(EvalState & state, const Strings & attrPaths,
bool parseOnly, bool strict, Bindings & autoArgs,
@ -55,6 +55,9 @@ void processExpr(EvalState & state, const Strings & attrPaths,
else if (output == okJSON) {
printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context);
std::cout << std::endl;
} else if (output == okRaw) {
std::cout << *state.coerceToString(noPos, vRes, context, "while generating the nix-instantiate output");
std::cout << std::endl;
} else {
if (strict) state.forceValueDeep(vRes);
std::set<const void *> seen;
@ -136,6 +139,8 @@ static int main_nix_instantiate(int argc, char * * argv)
outputKind = okXML;
else if (*arg == "--json")
outputKind = okJSON;
else if (*arg == "--raw")
outputKind = okRaw;
else if (*arg == "--no-location")
xmlOutputSourceLocation = false;
else if (*arg == "--strict")