If you run git2cpp -v or git2cpp --version you get the version information as requested but also the help information, so we need to avoid displaying the help information if the version flag is set, probably here:
|
if (app.get_subcommands().size() == 0) |
We could modify the test_version to assert that only one line is written to stdout, perhaps using something like p.stdout.count(b('\n')).