-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: show the help message instead of suggesting "go help subcommand" when the --help/-h flag is passed #27580
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
Comments
Yes please, I hate it when software says "Yes, I know what you mean, but you didn't say it right, here's how to say it right", rather than just doing what I ask. |
I think the point is to have the output text be small, to not take up the entirety of the user's screen. For example, see #26999. Perhaps the |
I often find myself not fully remembering the details of how various flags for different tools work, so my workflow is to start composing the command I want to run, then at the end add |
Is this really all there is in terms of discussion on this topic? I would've thought more than 4 people would've complained about this. For me, this is a huge annoyance. I frequently make a mistake with an argument For example, I frequently make errors on
and then want to look up the argument.
whoops, I used I think the difference between my frustration, and other people's lack of frustration, might be the fact that I deal with more than 1 programming language on a day-to-day basis. I frequently context-switch between Golang, bash, python, java, helm, and C. For people who primarily program in Golang, maybe simply remembering Is that all there is to this topic? I would've expected someone in here would be strongly against supporting |
The current pattern is that This is a situation where we can't possibly make everybody happy. To me the current approach doesn't seem like a terrible compromise. |
Ok, so there are people that are against supporting |
This proposal seems very similar to the concerns raised in this issue, and the proposal was accepted: #63659 |
I don't think these feel like similar topics in the way that solving #63659 would also solve this, but I could see how the proposal in #63659 being accepted could be seen as evidence that this issue won't move forward. The way I'd summarize this issue is that bash commands (especially coreutils commands) generally offer But these ideas don't need to go against eachother. |
#63659 proposes a specific format for Given #63659's acceptance, I'll close this as won't do. |
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: