If requested always print version and exit.

Previously this was only done if there were no other parameters on the
command line. That approach feels a bit unusual.
This commit is contained in:
Markus Blatt 2019-05-13 14:40:42 +02:00
parent 8197bcfc54
commit 18a404768e

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);
}
}
}
}