From d8576da5c491326e21d5ff3fc36faaf78c5f7e1e Mon Sep 17 00:00:00 2001 From: Kendall Weihe Date: Thu, 5 Oct 2023 21:27:11 +0000 Subject: [PATCH] Improve `ftl status` output readability (#456) Added JSON formatting w/ indents & line breaks for the ftl status output -- previously was a giant JSON all on one line --- cmd/ftl/cmd_ps.go | 2 +- cmd/ftl/cmd_status.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/ftl/cmd_ps.go b/cmd/ftl/cmd_ps.go index 3dff52ea79..04caa21983 100644 --- a/cmd/ftl/cmd_ps.go +++ b/cmd/ftl/cmd_ps.go @@ -27,7 +27,7 @@ func (s *psCmd) Run(ctx context.Context, client ftlv1connect.ControllerServiceCl return errors.WithStack(err) } if s.JSON { - marshaller := jsonpb.Marshaler{} + marshaller := jsonpb.Marshaler{Indent: " "} for _, process := range status.Msg.Processes { err = marshaller.Marshal(os.Stdout, process) if err != nil { diff --git a/cmd/ftl/cmd_status.go b/cmd/ftl/cmd_status.go index c8ce8094f6..32ec025407 100644 --- a/cmd/ftl/cmd_status.go +++ b/cmd/ftl/cmd_status.go @@ -37,5 +37,7 @@ func (s *statusCmd) Run(ctx context.Context, client ftlv1connect.ControllerServi deployment.Schema = nil } } - return errors.WithStack((&jsonpb.Marshaler{}).Marshal(os.Stdout, status.Msg)) + return errors.WithStack((&jsonpb.Marshaler{ + Indent: " ", + }).Marshal(os.Stdout, status.Msg)) }