mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
8197bcfc54
commit
18a404768e
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user