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

flag: better option parser #12251

Closed
2 of 3 tasks
techtonik opened this issue Aug 21, 2015 · 5 comments
Closed
2 of 3 tasks

flag: better option parser #12251

techtonik opened this issue Aug 21, 2015 · 5 comments

Comments

@techtonik
Copy link

There is a problem with command line usability of go. From #12197:

  • no long options like --help or --verbose
  • -h has a strict position, e.g. go get something -h doesn't work, only go get -h something
  • go get -h help is unreadable - lacks visual structure

There are more features that could be added to stdlib. Tools:

https://github.com/jawher/mow.cli
https://github.com/codegangsta/cli

@techtonik techtonik changed the title Use better option parser Go with better option parser Aug 21, 2015
@bradfitz
Copy link
Contributor

The behavior of Go's flag package is intentional.

@techtonik
Copy link
Author

@bradfitz it is not about changing flag behavior. Python also still ships with a getopt, but rarely who uses that.

@adg
Copy link
Contributor

adg commented Aug 21, 2015

@techtonik as a counterpoint: in my opinion the go tools' command line interface is well-defined, well-documented, and consistent. I can't really relate to your criticisms, except that it is a bit different to what you might be used to.

@ianlancetaylor
Copy link
Contributor

@techtonik The go standard flag package has made deliberate design choices. Those seem unlikely to change. At any rate, they would only change after a discussion of benefits and costs.

It is straightforward to write a different flag parsing package in Go, and to use that in your own programs. In fact, I'm sure it has been done, e.g., http://godoc.org/code.google.com/p/getopt .

@mikioh mikioh changed the title Go with better option parser flag: better option parser Aug 22, 2015
@techtonik
Copy link
Author

@adg maybe it is just a habit developed because there is no anything else in daily practice to compare with? =)

@golang golang locked and limited conversation to collaborators Aug 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants