From 83a9b402430ded95b2a7e63bc43bd37989313c6c Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 15 Jul 2024 10:25:19 -0400 Subject: [PATCH 1/4] Tweak server start-up text --- temporalcli/commands.server.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/temporalcli/commands.server.go b/temporalcli/commands.server.go index a0b8550e..11339145 100644 --- a/temporalcli/commands.server.go +++ b/temporalcli/commands.server.go @@ -144,11 +144,11 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string) return err } - cctx.Printer.Printlnf("%-16s %v:%v", "Temporal server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort) + cctx.Printer.Printlnf("%-8s %v:%v", "Server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort) if !t.Headless { - cctx.Printer.Printlnf("%-16s http://%v:%v", "Web UI:", toFriendlyIp(opts.UIIP), opts.UIPort) + cctx.Printer.Printlnf("%-8s http://%v:%v", "UI:", toFriendlyIp(opts.UIIP), opts.UIPort) } - cctx.Printer.Printlnf("%-16s http://%v:%v/metrics", "Metrics:", toFriendlyIp(opts.FrontendIP), opts.MetricsPort) + cctx.Printer.Printlnf("%-8s http://%v:%v/metrics", "Metrics:", toFriendlyIp(opts.FrontendIP), opts.MetricsPort) <-cctx.Done() cctx.Printer.Println("Stopping server...") return nil From 30ee8c6c72b8b112e5a2b4652aede24e24feb05c Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 15 Jul 2024 13:07:26 -0400 Subject: [PATCH 2/4] Add version string --- temporalcli/commands.go | 6 +++++- temporalcli/commands.server.go | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/temporalcli/commands.go b/temporalcli/commands.go index c49efd2f..88484afc 100644 --- a/temporalcli/commands.go +++ b/temporalcli/commands.go @@ -349,7 +349,7 @@ func Execute(ctx context.Context, options CommandOptions) { } func (c *TemporalCommand) initCommand(cctx *CommandContext) { - c.Command.Version = fmt.Sprintf("%s (server %s) (ui %s)", Version, headers.ServerVersion, version.UIVersion) + c.Command.Version = VersionString() // Unfortunately color is a global option, so we can set in pre-run but we // must unset in post-run origNoColor := color.NoColor @@ -394,6 +394,10 @@ func (c *TemporalCommand) initCommand(cctx *CommandContext) { } } +func VersionString() string { + return fmt.Sprintf("CLI %s (Server %s, UI %s)", Version, headers.ServerVersion, version.UIVersion) +} + func (c *TemporalCommand) preRun(cctx *CommandContext) error { // Configure logger if not already on context if cctx.Logger == nil { diff --git a/temporalcli/commands.server.go b/temporalcli/commands.server.go index 11339145..56697320 100644 --- a/temporalcli/commands.server.go +++ b/temporalcli/commands.server.go @@ -144,6 +144,7 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string) return err } + cctx.Printer.Printlnf(VersionString() + "\n") cctx.Printer.Printlnf("%-8s %v:%v", "Server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort) if !t.Headless { cctx.Printer.Printlnf("%-8s http://%v:%v", "UI:", toFriendlyIp(opts.UIIP), opts.UIPort) From 143b1d9d8f10be4908950bb03cccae16d1c1f1c6 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 15 Jul 2024 13:17:17 -0400 Subject: [PATCH 3/4] Don't add "CLI" to version string --- temporalcli/commands.go | 2 +- temporalcli/commands.server.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/temporalcli/commands.go b/temporalcli/commands.go index 88484afc..c5131420 100644 --- a/temporalcli/commands.go +++ b/temporalcli/commands.go @@ -395,7 +395,7 @@ func (c *TemporalCommand) initCommand(cctx *CommandContext) { } func VersionString() string { - return fmt.Sprintf("CLI %s (Server %s, UI %s)", Version, headers.ServerVersion, version.UIVersion) + return fmt.Sprintf("%s (Server %s, UI %s)", Version, headers.ServerVersion, version.UIVersion) } func (c *TemporalCommand) preRun(cctx *CommandContext) error { diff --git a/temporalcli/commands.server.go b/temporalcli/commands.server.go index 56697320..ed63325d 100644 --- a/temporalcli/commands.server.go +++ b/temporalcli/commands.server.go @@ -144,7 +144,7 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string) return err } - cctx.Printer.Printlnf(VersionString() + "\n") + cctx.Printer.Printlnf("CLI " + VersionString() + "\n") cctx.Printer.Printlnf("%-8s %v:%v", "Server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort) if !t.Headless { cctx.Printer.Printlnf("%-8s http://%v:%v", "UI:", toFriendlyIp(opts.UIIP), opts.UIPort) From a6bfe97ca211e296b7a913cc47066ad61d880195 Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Mon, 15 Jul 2024 13:20:58 -0400 Subject: [PATCH 4/4] String formatting style --- temporalcli/commands.server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/temporalcli/commands.server.go b/temporalcli/commands.server.go index ed63325d..3bc4ac32 100644 --- a/temporalcli/commands.server.go +++ b/temporalcli/commands.server.go @@ -144,7 +144,7 @@ func (t *TemporalServerStartDevCommand) run(cctx *CommandContext, args []string) return err } - cctx.Printer.Printlnf("CLI " + VersionString() + "\n") + cctx.Printer.Printlnf("CLI %v\n", VersionString()) cctx.Printer.Printlnf("%-8s %v:%v", "Server:", toFriendlyIp(opts.FrontendIP), opts.FrontendPort) if !t.Headless { cctx.Printer.Printlnf("%-8s http://%v:%v", "UI:", toFriendlyIp(opts.UIIP), opts.UIPort)