mirror of
https://github.com/NixOS/nix
synced 2024-10-18 00:16:11 -04:00
Merge 8bd591db03
into ca3fc1693b
This commit is contained in:
commit
57eb0a2bcf
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue