Setting up program options
The first task we need to address is setting up the command-line interface for the program. At the very least, this must be able to parse the names of one or more files to process to pass to the inner workings of the program that we will write later. However, there are several other things we want to add here, such as turning on verbose logging, controlling the threading environment, and controlling the format of the output. We also want our command-line interface to produce usage information when the arguments are malformed or when the standard -h or --help option is passed.
There are a few libraries that we could use to create such an interface quickly and easily, including Abseil’s program options library, but we’re going to use Boost program options because it is very standard and easy to use. The library can be installed in many different ways and, depending on your operating system, you might opt for a different option. We’...