Skip to content

Commit

Permalink
Merge pull request #1842 from blattms/always-print-version-if-requested
Browse files Browse the repository at this point in the history
If requested always print version and exit.
  • Loading branch information
atgeirr authored May 15, 2019
2 parents 6f4c737 + 18a4047 commit 41ef80d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions flow/flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 41ef80d

Please sign in to comment.