File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ (* Gpumon CLI *)
3+
4+ module Cmds = Gpumon_interface. RPC_API (Cmdlinergen. Gen () )
5+
6+ let version_str description =
7+ let maj,min,mic = description.Idl.Interface. version in
8+ Printf. sprintf " %d.%d.%d" maj min mic
9+
10+ let default_cmd =
11+ let doc = String. concat " " [
12+ " A CLI for the GPU monitoring API. This allows scripting of the gpumon daemon " ;
13+ " for testing and debugging. This tool is not intended to be used as an " ;
14+ " end user tool" ] in
15+ Cmdliner.Term. (ret (const (fun _ -> `Help (`Pager , None )) $ const () )),
16+ Cmdliner.Term. info " gpumon_cli" ~version: (version_str Cmds. description) ~doc
17+
18+ let cli () =
19+ let rpc = Gpumon_client. rpc in
20+ Cmdliner.Term. eval_choice default_cmd (List. map (fun t -> t rpc) (Cmds. implementation () ))
21+
22+ let _ = cli ()
You can’t perform that action at this time.
0 commit comments