Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stricter arguments parsing #406

Merged
merged 12 commits into from
Jun 6, 2018
Merged

Conversation

karjonas
Copy link
Contributor

@karjonas karjonas commented Jun 4, 2018

This PR make Brayns exit if invoked with incorrect arguments. It also add the possibility to add arguments to plugins.

@karjonas karjonas requested a review from tribal-tec June 4, 2018 11:26
@@ -143,12 +144,20 @@ struct Brayns::Impl : public PluginAPI
<< "' is not a valid Brayns plugin; missing "
"brayns_plugin_create()"
<< std::endl;
return;
exit(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EXIT_FAILURE

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(...or throw to have a single exit point below)

Brayns::~Brayns()
{
}
Brayns::~Brayns() {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= default in the header

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be in the cpp file due to the pimpl pattern.

@@ -82,6 +88,8 @@ class ApplicationParameters : public AbstractParameters
_updateValue(_synchronousMode, synchronousMode);
}

bool getParallelRendering() { return _parallelRendering; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const function

@@ -79,6 +78,7 @@ void ParametersManager::parse(int argc, const char** argv)
catch (po::error& e)
{
BRAYNS_ERROR << e.what() << std::endl;
exit(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also EXIT_FAILURE

}

ospInit(&argc, newArgv.data());
ospInit(&argc, argv.data());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for consistency, argv[0] should be still the app name imo. I don't know if ospray needs that internally or expects it to be there.

@karjonas
Copy link
Contributor Author

karjonas commented Jun 5, 2018

Issues fixed and rebased.

@karjonas karjonas merged commit aa2e6b8 into BlueBrain:master Jun 6, 2018
@karjonas karjonas deleted the arguments_parsing branch June 11, 2018 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants