diff --git a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml index 27b1429e2..88f47989c 100644 --- a/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml +++ b/src/proto_alpha/lib_client_commands/client_proto_context_commands.ml @@ -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 ;