зеркало из https://github.com/golang/tools.git
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 <deklerk@google.com> Run-TryBot: Jean de Klerk <deklerk@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Родитель
640c1dea83
Коммит
77c1b7a4f7
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче