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
commit 41ef80dd7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -99,14 +99,14 @@ 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) {
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);
}
}
}
}