docopt/docopt.go — pull request #8 by mboersma (2014-04-04 00:53:28+00:00)
Title: Rename parse() to ParseSafe(), fixes #7.

The docopt.go API is the simple [`Parse()`](https://github.com/docopt/docopt.go/blob/master/docopt.go#L88) function. But on bad input or implied usage, `Parse()` calls [`os.Exit()`](http://golang.org/pkg/os/#Exit). For library-type code, that is [bad form](https://groups.google.com/d/msg/golang-nuts/4EWf2CzXzgU/0El5IGkcmLkJ) in Go. In practice, it makes it impossible to write unit tests for a command-line tool using docopt, since there is no way to trap `os.Exit()`, and there is no alternate docopt.go API to `Parse()`.

This pull request exports the `parse()` implementation function by renaming it to [`ParseSafe()`](https://github.com/mboersma/docopt.go/blob/os-exit-workaround/docopt.go#L101). No existing uses of `Parse()` will break, and those who need to avoid `os.Exit()` or write unit tests can call `ParseSafe()` instead.