Don't write parser code: a good help message already has all the necessary information in it.
That is the philosophy of docopt in a nutshell.
Back during the Stone Age of Deis—almost eight lunar months ago—I was enthused about docopt for Python. Think about what commands and options your tool needs, type them out into docstrings, and you're basically done with the user input and validation side of things.
As of today the Deis team is helping maintain the docopt-go project on GitHub. Recent improvements include:
go get github.com/docopt/docopt-gonow works
os.Exit()if optional parameter
- tests run at Travis CI
- docs hosted at GoDoc.org