rthurman/hotspot — pull request #1 by alexpreynolds (2014-04-17 20:02:57+00:00)
Title: Added --help and --version options to hotspot v4.1.0 binary

I added code so that users can type in the option `-h` or `--help` to get a usage statement sent to standard output (exiting with a zero error code), and `-v` or `--version` to get the hotspot binary version and author/citation details sent to standard output (exiting with a zero error code).

If the incorrect number of arguments are specified, the binary still prints the same usage statement, but it is sent to standard error (exiting with the same non-zero error code as before).

These options work by throwing different types of custom exceptions, which can be modified in and added to in the `hotspot` namespace in `Cluster.cpp`, as more options are added down the road. The `hotspot` namespace is also where the version, author and citation strings are kept, for easy modification as new versions of the application are published.

The `--version` option format tries to follow the pattern used in BEDOPS tools, although the layout and content is easily modified by editing the output of the `hotspot::Version()` function in `Cluster.cpp`.