Skip to content

Commit

Permalink
Merge pull request #580 from ASNeG/579_command_line_parser_error
Browse files Browse the repository at this point in the history
windows adjustments
  • Loading branch information
huebl authored Dec 18, 2023
2 parents 6d8ec4c + 6556635 commit 5ec6b0a
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 48 deletions.
106 changes: 58 additions & 48 deletions src/OpcUaGenerator/OpcUaEventTypeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,56 +61,64 @@ namespace OpcUaEventTypeGenerator
uint32_t
OpcUaEventTypeGenerator::start(int argc, char** argv)
{
boost::program_options::variables_map vm;
boost::program_options::options_description desc("Allowed options");
desc.add_options()
(
"help",
"produce help message"
)
(
"version",
"print version string"
)
(
"nodeset",
boost::program_options::value<std::vector<std::string> >(),
"set nodeset file name (mandatory)"
)
(
"eventtype",
boost::program_options::value<std::string>(),
"set event type name (mandatory)"
)
(
"namespaces",
boost::program_options::value< std::vector<std::string> >(),
"set project namespaces"
)
(
"projectNamespace",
boost::program_options::value<std::string>()->default_value("OpcUaStackCore"),
"set project namespace"
)
(
"parentProjectNamespace",
boost::program_options::value<std::string>()->default_value("OpcUaStackCore"),
"set parent project namespace"
)
(
"buildSubTypes",
boost::program_options::value<bool>()->default_value(false),
"build all subtypes"
)
(
"ignoreEventTypeName",
boost::program_options::value< std::vector<std::string> >(),
"ignore event type name"
)
;

boost::program_options::variables_map vm;
boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
boost::program_options::notify(vm);
try {
desc.add_options()
(
"help",
"produce help message"
)
(
"version",
"print version string"
)
(
"nodeset",
boost::program_options::value<std::vector<std::string> >(),
"set nodeset file name (mandatory)"
)
(
"eventtype",
boost::program_options::value<std::string>(),
"set event type name (mandatory)"
)
(
"namespaces",
boost::program_options::value<std::vector<std::string> >(),
"set project namespaces"
)
(
"projectNamespace",
boost::program_options::value<std::string>()->default_value("OpcUaStackCore"),
"set project namespace"
)
(
"parentProjectNamespace",
boost::program_options::value<std::string>()->default_value("OpcUaStackCore"),
"set parent project namespace"
)
(
"buildSubTypes",
boost::program_options::value<bool>()->default_value(false),
"build all subtypes"
)
(
"ignoreEventTypeName",
boost::program_options::value< std::vector<std::string> >(),
"ignore event type name"
)
;

boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
boost::program_options::notify(vm);
}
catch (const boost::program_options::error& ex)
{
std::cout << ex.what() << std::endl;
return 1;
}

if (vm.count("help")) {
std::cout << desc << std::endl;
Expand Down Expand Up @@ -148,6 +156,7 @@ namespace OpcUaEventTypeGenerator
ignoreEventTypeNameVec_ = vm["ignoreEventTypeName"].as< std::vector<std::string> >();
}

std::cout << "XX" << std::endl;
if (buildSubTypes_) {
return buildAllSubTypes();
}
Expand All @@ -163,6 +172,7 @@ namespace OpcUaEventTypeGenerator
return rc;
}

std::cout << "XX" << std::endl;
return generateEventTypeSource();
}

Expand Down
1 change: 1 addition & 0 deletions src/OpcUaStackCore/PKI/PKIStoreFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/uuid/detail/sha1.hpp>

#include <sstream>
Expand Down

0 comments on commit 5ec6b0a

Please sign in to comment.