From 77c1b7a4f75cdcf4496b2f63ce23ca3cc807b0ed Mon Sep 17 00:00:00 2001 From: Jean de Klerk Date: Fri, 25 Jun 2021 08:55:41 -0600 Subject: [PATCH] internal/lsp/cmd: print flags when running gopls help Currently, flags are not being printed when users run `gopls help` because they never get parsed in Main. This CL fixes that issue. Updates golang/go#35855 Change-Id: Ic9882d0d2410a0f045aa0ecaa87b36c23eb569fd Reviewed-on: https://go-review.googlesource.com/c/tools/+/330854 Trust: Jean de Klerk Run-TryBot: Jean de Klerk gopls-CI: kokoro TryBot-Result: Go Bot Reviewed-by: Robert Findley --- internal/tool/tool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/tool/tool.go b/internal/tool/tool.go index ecf68d7c1..41ecd4ee3 100644 --- a/internal/tool/tool.go +++ b/internal/tool/tool.go @@ -88,6 +88,7 @@ func Main(ctx context.Context, app Application, args []string) { fmt.Fprintf(s.Output(), "\n\nUsage: %v [flags] %v\n", app.Name(), app.Usage()) app.DetailedHelp(s) } + addFlags(s, reflect.StructField{}, reflect.ValueOf(app)) if err := Run(ctx, app, args); err != nil { fmt.Fprintf(s.Output(), "%s: %v\n", app.Name(), err) if _, printHelp := err.(commandLineError); printHelp {