Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: improve command-line help output #35855
First I tried
So this shows the flags (for which command?), but not the actual commands. Next I tried
That works, but only accidentally ("Unknown command help"). Also note the trailing "gopls flags are:" followed by no flags.
Finally, I tried running
This does not provide enough information to actually use
We should improve this situation:
For bonus points:
@stamblerre Currently all of the commands are printed as a signle list:
What do you think about separating this into "main" (looking for better naming) commands and "features" that can be run adhoc like this:
I think it shows intent of the commands more clearly.
OK, one more question. Should running command without any flag nor command behave like this? I find it confusing:
If you'll not provide valid json rpc message it does nothing and when you hit enter you get missing content message. My proposition is to print help whenever you run just
And one more again ;)
concern only gopls
@stamblerre could you tell me about this compatibility thing?
It pops here as well https://github.com/golang/tools/blob/master/internal/lsp/cmd/cmd.go#L43:
With this my proposal cannot be done and probably I am missing some context and discussion that took place some time ago.
Descriptions of certain commands were changed to not start with capital letter. All of the commands were splitted into so called main commands and feature commands. Package tool did have a limitation that revealed itself when command was invoked only with `-h`, i.e. `gopls -h`. Limitation was that in above mentioned case, FlagSet.Parse() was intercepting `-h` flag and printing just default usage. Updates golang/go#35855 Change-Id: I9bd27fc72e8fb8d18025d95ebcae974dd5583e91 Reviewed-on: https://go-review.googlesource.com/c/tools/+/210359 Run-TryBot: Ian Cottrell <firstname.lastname@example.org> TryBot-Result: Gobot Gobot <email@example.com> Reviewed-by: Ian Cottrell <firstname.lastname@example.org>
Hm, actually I think there is still work to do here (see #35855 (comment)).