Implement 'whenjobs --daemon-stop'
[whenjobs.git] / tools / whenjobs.ml
index dade6c2..0810649 100644 (file)
@@ -319,7 +319,15 @@ and daemon_start () =
   assert false
 
 and daemon_stop () =
-  assert false
+  let client = start_client () in
+  (match Whenproto_clnt.When.V1.exit_daemon client () with
+  | `ok -> ()
+  | `error msg ->
+    eprintf "whenjobs: daemon-stop: %s\n" msg;
+    suggest_check_server_logs ();
+    exit 1
+  );
+  stop_client client
 
 and daemon_restart () =
   assert false