mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 11:49:35 +01:00
nix-instantiate --eval --xml: Devirtualize the output
This commit is contained in:
parent
df7a2a1bed
commit
31e58dcb92
1 changed files with 7 additions and 3 deletions
|
|
@ -59,12 +59,16 @@ void processExpr(EvalState & state, const Strings & attrPaths,
|
||||||
context);
|
context);
|
||||||
// We intentionally don't output a newline here. The default PS1 for Bash in NixOS starts with a newline
|
// We intentionally don't output a newline here. The default PS1 for Bash in NixOS starts with a newline
|
||||||
// and other interactive shells like Zsh are smart enough to print a missing newline before the prompt.
|
// and other interactive shells like Zsh are smart enough to print a missing newline before the prompt.
|
||||||
else if (output == okXML)
|
else if (output == okXML) {
|
||||||
printValueAsXML(state, strict, location, vRes, std::cout, context, noPos);
|
std::ostringstream s;
|
||||||
|
printValueAsXML(state, strict, location, vRes, s, context, noPos);
|
||||||
|
std::cout << state.devirtualize(s.str(), context);
|
||||||
|
}
|
||||||
else if (output == okJSON) {
|
else if (output == okJSON) {
|
||||||
auto j = printValueAsJSON(state, strict, vRes, v.determinePos(noPos), context);
|
auto j = printValueAsJSON(state, strict, vRes, v.determinePos(noPos), context);
|
||||||
std::cout << state.devirtualize(j.dump(), context) << std::endl;
|
std::cout << state.devirtualize(j.dump(), context) << std::endl;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
if (strict) state.forceValueDeep(vRes);
|
if (strict) state.forceValueDeep(vRes);
|
||||||
std::set<const void *> seen;
|
std::set<const void *> seen;
|
||||||
printAmbiguous(state, vRes, std::cout, &seen, std::numeric_limits<int>::max());
|
printAmbiguous(state, vRes, std::cout, &seen, std::numeric_limits<int>::max());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue