Commit fbe8d4bd authored by Fardale's avatar Fardale Committed by Fardale

begin to use cmdliner for command line argument

parent 66a2593c
......@@ -2,6 +2,6 @@
(executable (
(name ocluster)
(libraries (lwt.unix lwt_log lwt unix ppx_deriving.show))
(libraries (lwt.unix lwt_log lwt cmdliner unix ppx_deriving.show))
(preprocess (pps (ppx_deriving.show lwt_ppx)))
(modules (ocluster))))
......@@ -86,7 +86,21 @@ let main pass port =
_ = Lwt_unix.on_signal 15 (stop_server resolver server) in promise
>>= fun server -> Lwt_io.shutdown_server server <&> Lwt_log.info "Shuting down server"
open Cmdliner
let _ =
let port =
let doc = "port on which client listen" in
Arg.(value & opt int 4242 & info ["p"; "port"] ~docv:"PORT" ~doc) in
let info =
let doc = "Transforme un pool of computer into a cluster." in
let man = [
`S Manpage.s_bugs;
`P "Email bug reports to <fardale+ocluster at crans.org>." ]
in
Term.info "ocluster" ~version:"%%VERSION%%" ~doc ~exits:Term.default_exits ~man
in
Lwt_main.run (main "plopissecured" 2121)
(*Lwt_io.with_connection (Lwt_unix.ADDR_INET (Unix.inet_addr_of_string "127.0.0.1", 2121)) (fun (ic,oc) -> Lwt_io.write_value oc (COMPUTATION {id = 0; script = "#echo penis\necho plop\nls"; time = None; pass = "wesh"}));;*)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment