cmd/go: show the help message instead of suggesting "go help subcommand" when the --help/-h flag is passed #27580
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
I asked to print the help usage of the command
go list
:What did you expect to see?
I would like to see the help output instead of suggesting me to run
go help list
.What did you see instead?
It suggested to me to run
go help list
.I think this is a not very user friendly output.
--help
(or-h
) is a very common flag and is even parsed by theflag
package. Thego
command understand that I'm seeking for a help, instead of suggesting me to rungo help list
, it should show me the help message.As an example user case, suppose you run a command and somehow wrote it wrong:
If the
go
command would support the--help
/-h
flags, I could press theup
key on my keyboard (the shell would show the last executed command) and append the--help
flag to see what's wrong:This example is not only about
go list
itself, this applies to every single subcommand of thego
command. This happens so many times and I think it's counter intuitive to write a comand from scratch (i.e:go help list
,go help test
, ...). I don't know the origin why--help
or-h
is permitted and not allowed to be used, but if it's something that can be removed, I suggest we remove the restriction and show the help message instead of suggesting to callgo help subcommand
(for subcommand related --help messages).The text was updated successfully, but these errors were encountered: