The following is a simple example of using Go's flag package to parse command-line options.
The complete source is available as a zip file.