Skip to content

Commit

Permalink
Merge pull request #245 from graft-project/fix/cmdline
Browse files Browse the repository at this point in the history
Unrecognized command line parameter crash fixed
  • Loading branch information
mbg033 authored Mar 19, 2019
2 parents 8d4e2d8 + d864a4d commit 14a3d26
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/supernode/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,17 @@ bool GraftServer::initConfigOption(int argc, const char** argv, ConfigOpts& conf
#endif
("log-format", po::value<std::string>(), "e.g. %datetime{%Y-%M-%d %H:%m:%s.%g} %level %logger %rfile %msg");

po::store(po::parse_command_line(argc, argv, desc), vm);
try
{
po::store(po::parse_command_line(argc, argv, desc), vm);
}
catch(std::exception& ex)
{
std::cout << "Exception : " << ex.what() << "\n";
usage(desc);
exit(EXIT_FAILURE);
}

po::notify(vm);

if (vm.count("help")) {
Expand Down

0 comments on commit 14a3d26

Please sign in to comment.