Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/gopls: improve output for subcommands with no flags #43447

Open
ainar-g opened this issue Dec 31, 2020 · 5 comments
Open

x/tools/gopls: improve output for subcommands with no flags #43447

ainar-g opened this issue Dec 31, 2020 · 5 comments
Labels
gopls Issues related to the Go language server, gopls. help wanted Tools This label describes issues relating to any tools in the x/tools repository.

Comments

@ainar-g
Copy link
Contributor

ainar-g commented Dec 31, 2020

Currently (golang/tools@63754364767c), the output of gopls check -h looks like this:

show diagnostic results for the specified file

Usage: check [flags] <filename>

Example: show the diagnostic results of this file:

  $ gopls check internal/lsp/cmd/check.go

	gopls check flags are:

That is, no flags are documented. If gopls check actually has flags, they should probably be documented, and if not, the output should probably not mention them at all.

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Dec 31, 2020
@gopherbot gopherbot added this to the Unreleased milestone Dec 31, 2020
@rentziass
Copy link
Contributor

I believe this was fixed by golang.org/cl/284215?

@ainar-g
Copy link
Contributor Author

ainar-g commented Oct 11, 2021

@rentziass, I've checked gopls from master, and the message is better, but there is still the [flags] in there:

$ gopls check -h
  show diagnostic results for the specified file

  Usage: check [flags] <filename>

  Example: show the diagnostic results of this file:

    $ gopls check internal/lsp/cmd/check.go

Ironically, the -h flag, which I used to get this message, isn't documented in the message itself.

@rentziass
Copy link
Contributor

I see, that probably doesn't come from the commands themselves but something higher up. Let me have a look.

@gopherbot
Copy link

Change https://golang.org/cl/357994 mentions this issue: internal/tool: remove [flags] when not necessary

@ianthehat
Copy link

gopls check does support flags, it is the default flag set that applies to all commands. This is not well documented though, and the help is confusing. The same thing is true of many of the other sub-commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. help wanted Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants