Merge pull request #1842 from blattms/always-print-version-if-requested

If requested always print version and exit.
This commit is contained in:
Atgeirr Flø Rasmussen
2019-05-15 15:13:24 +02:00
committed by GitHub

View File

@@ -99,12 +99,12 @@ namespace detail
// the call is intercepted by this function which will print "flow $version"
// on stdout and exit(0).
void handleVersionCmdLine(int argc, char** argv) {
if (argc != 2)
return;
if (std::strcmp(argv[1], "--version") == 0) {
std::cout << "flow " << Opm::moduleVersionName() << std::endl;
std::exit(EXIT_SUCCESS);
for ( int i = 1; i < argc; ++i )
{
if (std::strcmp(argv[i], "--version") == 0) {
std::cout << "flow " << Opm::moduleVersionName() << std::endl;
std::exit(EXIT_SUCCESS);
}
}
}