diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-08-07 19:32:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-07 19:32:49 +0200 |
commit | 5624777988e0b8368eb019fc8d3e4fc1ff5790e0 (patch) | |
tree | e30d034694ca8e281862c9c9ca8e912388a2ed97 /src | |
parent | 4999f42a70468b62f51afef98f8c4070c02659d8 (diff) | |
parent | 7c09104a943978a165885e10697b418f8bab2795 (diff) |
Merge pull request #8786 from Ma27/fix-why-depends-precise
nix/why-depends: fix output of `--precise`
Diffstat (limited to 'src')
-rw-r--r-- | src/nix/why-depends.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nix/why-depends.cc b/src/nix/why-depends.cc index a3a9dc698..592de773c 100644 --- a/src/nix/why-depends.cc +++ b/src/nix/why-depends.cc @@ -239,7 +239,7 @@ struct CmdWhyDepends : SourceExprCommand, MixOperateOnOptions if (pos != std::string::npos) { size_t margin = 32; auto pos2 = pos >= margin ? pos - margin : 0; - hits[hash].emplace_back(fmt("%s: …%s…\n", + hits[hash].emplace_back(fmt("%s: …%s…", p2, hilite(filterPrintable( std::string(contents, pos2, pos - pos2 + hash.size() + margin)), @@ -255,7 +255,7 @@ struct CmdWhyDepends : SourceExprCommand, MixOperateOnOptions for (auto & hash : hashes) { auto pos = target.find(hash); if (pos != std::string::npos) - hits[hash].emplace_back(fmt("%s -> %s\n", p2, + hits[hash].emplace_back(fmt("%s -> %s", p2, hilite(target, pos, StorePath::HashLen, getColour(hash)))); } } @@ -272,9 +272,9 @@ struct CmdWhyDepends : SourceExprCommand, MixOperateOnOptions for (auto & hit : hits[hash]) { bool first = hit == *hits[hash].begin(); - std::cout << tailPad - << (first ? (last ? treeLast : treeConn) : (last ? treeNull : treeLine)) - << hit; + logger->cout("%s%s%s", tailPad, + (first ? (last ? treeLast : treeConn) : (last ? treeNull : treeLine)), + hit); if (!all) break; } |