about summary refs log tree commit diff
path: root/src/nix-worker/main.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-02T14·27+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-02T14·27+0000
commit8ba5d32769560d32cb5e1e83fd30fb6da0b145f4 (patch)
tree5387182858fe66bba87f0f0891507fc248ccbaef /src/nix-worker/main.cc
parentfcd9900d74b0eb3d57402c448ede2a411133fa46 (diff)
* Remove queryPathHash().
* Help for nix-worker.

Diffstat (limited to 'src/nix-worker/main.cc')
-rw-r--r--src/nix-worker/main.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nix-worker/main.cc b/src/nix-worker/main.cc
index 6d6571536b9c..95077e653135 100644
--- a/src/nix-worker/main.cc
+++ b/src/nix-worker/main.cc
@@ -5,6 +5,8 @@
 #include "worker-protocol.hh"
 #include "archive.hh"
 
+#include <iostream>
+
 using namespace nix;
 
 
@@ -48,12 +50,13 @@ void processConnection(Source & from, Sink & to)
 
         switch (op) {
 
-        case wopQuit:
+        case wopQuit: {
             /* Close the database. */
             store.reset((StoreAPI *) 0);
             writeInt(1, to);
             quit = true;
             break;
+        }
 
         case wopIsValidPath: {
             Path path = readStorePath(from);
@@ -67,6 +70,12 @@ void processConnection(Source & from, Sink & to)
             break;
         }
 
+        case wopQueryPathHash: {
+            Path path = readStorePath(from);
+            writeString(printHash(store->queryPathHash(path)), to);
+            break;
+        }
+
         case wopQueryReferences:
         case wopQueryReferrers: {
             Path path = readStorePath(from);
@@ -153,8 +162,11 @@ void run(Strings args)
 }
 
 
+#include "help.txt.hh"
+
 void printHelp()
 {
+    std::cout << string((char *) helpText, sizeof helpText);
 }