-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from jonludlam/ppx2
PPX memory interface
- Loading branch information
Showing
7 changed files
with
447 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
(* Memory CLI *) | ||
|
||
open Memory_interface | ||
open Xcp_client | ||
open Memory_client | ||
|
||
module Cmds = API(Cmdlinergen.Gen ()) | ||
|
||
let version_str description = | ||
let maj,min,mic = description.Idl.Interface.version in | ||
Printf.sprintf "%d.%d.%d" maj min mic | ||
|
||
let default_cmd = | ||
let doc = String.concat "" [ | ||
"A CLI for the memory API. This allows scripting of the squeeze daemon "; | ||
"for testing and debugging. This tool is not intended to be used as an "; | ||
"end user tool"] in | ||
Cmdliner.Term.(ret (const (fun _ -> `Help (`Pager, None)) $ const ())), | ||
Cmdliner.Term.info "memory_cli" ~version:(version_str Cmds.description) ~doc | ||
|
||
let cli () = | ||
let rpc = Memory_client.rpc in | ||
Cmdliner.Term.eval_choice default_cmd (List.map (fun t -> t rpc) (Cmds.implementation ())) | ||
|
||
let _ = cli () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.