Commit ff4a5fad authored by Milo Davis's avatar Milo Davis Committed by Grégoire Henry

Client: get timestamp in seconds

parent 439435bd
......@@ -52,12 +52,17 @@ let commands () =
let open Clic in
[
command ~group ~desc: "Access the timestamp of the block."
no_options
(args1
(switch ~doc:"output time in seconds" ~short:'s' ~long:"seconds" ()))
(fixed [ "get" ; "timestamp" ])
begin fun () (cctxt : Proto_alpha.full) ->
begin fun seconds (cctxt : Proto_alpha.full) ->
Block_services.timestamp
cctxt cctxt#block >>=? fun v ->
cctxt#message "%s" (Time.to_notation v) >>= fun () ->
begin
if seconds
then cctxt#message "%Ld" (Time.to_seconds v)
else cctxt#message "%s" (Time.to_notation v)
end >>= fun () ->
return ()
end ;
......
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