about summary refs log tree commit diff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 22effc65dc77..e22ef7efcefb 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -6,6 +6,7 @@
 #include "archive.hh"
 #include "shared.hh"
 #include "dotgraph.hh"
+#include "xmlgraph.hh"
 #include "local-store.hh"
 #include "util.hh"
 #include "help.txt.hh"
@@ -226,7 +227,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
 {
     enum { qOutputs, qRequisites, qReferences, qReferrers
          , qReferrersClosure, qDeriver, qBinding, qHash
-         , qTree, qGraph, qResolve, qRoots } query = qOutputs;
+         , qTree, qGraph, qXml, qResolve, qRoots } query = qOutputs;
     bool useOutput = false;
     bool includeOutputs = false;
     bool forceRealise = false;
@@ -249,6 +250,7 @@ static void opQuery(Strings opFlags, Strings opArgs)
         else if (*i == "--hash") query = qHash;
         else if (*i == "--tree") query = qTree;
         else if (*i == "--graph") query = qGraph;
+        else if (*i == "--xml") query = qXml;
         else if (*i == "--resolve") query = qResolve;
         else if (*i == "--roots") query = qRoots;
         else if (*i == "--use-output" || *i == "-u") useOutput = true;
@@ -327,7 +329,15 @@ static void opQuery(Strings opFlags, Strings opArgs)
             PathSet roots;
             foreach (Strings::iterator, i, opArgs)
                 roots.insert(maybeUseOutput(followLinksToStorePath(*i), useOutput, forceRealise));
-	    printDotGraph(roots);
+            printDotGraph(roots);
+            break;
+        }
+
+        case qXml: {
+            PathSet roots;
+            foreach (Strings::iterator, i, opArgs)
+                roots.insert(maybeUseOutput(followLinksToStorePath(*i), useOutput, forceRealise));
+            printXmlGraph(roots);
             break;
         }