Permalink
Browse files

cli: example of getting hv/lib versions

  • Loading branch information...
msantos committed Sep 25, 2012
1 parent ab86e79 commit 46a177498aa49b3d247984954bab734a1931ecdf
Showing with 19 additions and 0 deletions.
  1. +19 −0 bin/verx
View
@@ -159,6 +159,18 @@ call(["undefine", Name | Arg]) ->
{ok, [Domain]} = lookup(Ref, {domain, Name}),
rp(verx:domain_undefine(Ref, [Domain]));
+call(["version" | Arg]) ->
+ Opt = getopt(Arg),
+ {ok, Ref} = connect(Opt),
+
+ {ok, [Type]} = verx:get_type(Ref),
+ {ok, [Version]} = verx:get_version(Ref),
+ {ok, [Lib]} = verx:get_lib_version(Ref),
+
+ rp({ok, [{type, Type},
+ {version, version(Version)},
+ {lib_version, version(Lib)}]});
+
call(["pool-list" | Arg]) ->
Opt = getopt(Arg),
{ok, Ref} = connect(Opt),
@@ -312,6 +324,7 @@ call(_) ->
"send-key",
"shutdown",
"undefine",
+ "version",
"net-autostart",
"net-create",
@@ -518,3 +531,9 @@ console_read(Ref) ->
verx_client:send(Ref, Buf),
console_read(Ref)
end.
+
+version(Version) when is_integer(Version) ->
+ Major = Version div 1000000,
+ Minor = Version rem 1000000 div 1000,
+ Release = Version rem 1000000 rem 1000,
+ {Major, Minor, Release}.

0 comments on commit 46a1774

Please sign in to comment.