Yaron Minsky avatar Yaron Minsky committed db16793

improved comments in client

Comments (0)

Files changed (1)

 open Broker_protocol
 module Ascii_table = Textutils.Std.Ascii_table
 
-let shutdown =
-  Common.with_rpc_conn (fun conn ->
-    Rpc.Rpc.dispatch_exn shutdown_rpc conn ())
-
 let host_and_port () =
   Command.Spec.(
     empty
     +> Common.port_arg ()
   )
 
+(* Shutdown command *****************************************)
+
+let shutdown =
+  Common.with_rpc_conn (fun conn ->
+    Rpc.Rpc.dispatch_exn shutdown_rpc conn ())
+
 let shutdown_cmd =
   Command.async_basic (host_and_port ())
     ~summary:"Shut the broker down"
     (fun host port () -> shutdown ~host ~port)
 
+(* Publish command ******************************************)
+
 let publish ~topic ~text =
   Common.with_rpc_conn (fun conn ->
     let from =
     )
     (fun host port topic text () -> publish ~host ~port ~topic ~text)
 
+(* Subscribe command ****************************************)
+
 let subscribe ~topic =
   Common.with_rpc_conn (fun conn ->
     let clear_string = "\027[H\027[2J" in
     )
     (fun host port topic () -> subscribe ~host ~port ~topic)
 
+(* Dump command *********************************************)
+
 let sexp_print_dump dump =
   printf "%s\n"
     (Dump.sexp_of_t dump |> Sexp.to_string_hum)
     )
     (fun host port sexp () -> dump ~host ~port ~sexp)
 
+(* Clear command ********************************************)
+
 let clear topic =
   Common.with_rpc_conn (fun conn ->
     Rpc.Rpc.dispatch_exn clear_rpc conn topic)
     )
     (fun host port topic () -> clear topic ~host ~port)
 
+(* Execution of final command *******************************)
+
+
 let () =
   Command.run
     (Command.group ~summary:"Utilities for interacting with message broker"
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.