diff options
-rw-r--r-- | src/nix.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nix.cc b/src/nix.cc index e9f04ff59d..a7bcf72684 100644 --- a/src/nix.cc +++ b/src/nix.cc @@ -185,7 +185,7 @@ static void opQuery(Strings opFlags, Strings opArgs) FState fs = parseFState(termFromId(id)); - string label; + string label, shape; if (fs.type == FState::fsDerive) { for (FSIds::iterator i = fs.derive.inputs.begin(); @@ -197,6 +197,7 @@ static void opQuery(Strings opFlags, Strings opArgs) } label = "derive"; + shape = "box"; for (StringPairs::iterator i = fs.derive.env.begin(); i != fs.derive.env.end(); i++) if (i->first == "name") label = i->second; @@ -204,12 +205,17 @@ static void opQuery(Strings opFlags, Strings opArgs) else if (fs.type == FState::fsSlice) { label = baseNameOf((*fs.slice.elems.begin()).path); + shape = "ellipse"; + if (isHash(string(label, 0, Hash::hashSize * 2)) && + label[Hash::hashSize * 2] == '-') + label = string(label, Hash::hashSize * 2 + 1); } else abort(); cout << dotQuote(id) << "[label = " << dotQuote(label) + << ", shape = " << shape << "];\n"; } } |