Optopia is a simple utility library for parsing options, much in the
style of getopt()
or getopt_long()
, but for Go programs.
Why yet another getopt
clone?
We needed some basic functionality with easy callbacks that could be used disconnected from an application (so that we could create individual instances of an application to facilitate testing.) It wasn’t immediately obvious that any of the usual suspects met that need.
There are many other option parsers that offer more richness. Please feel free to use those if that’s what you’re looking for; we’ve aimed for simplicity.
Note that some option parsers work by using reflection and structure tags. We find that a bit obtuse, and difficult to use. Such approaches also bypass the good type validation that Go gives us, so we “opt” (pardon the pun) to let the language help us.
For docs, see https://godoc.org/gdamore/optopia or run:
$ godoc -http=:6060
None, apart from things found in the standard library. Optopia should be portable to any platform Go runs on.