Updated cxxopts to 2.0.0.
Starting from version 2.0.0, cxxopts returns a ParseResult object instead of storing the results directly within the Options structure. Additionally, Booleans are handled slightly differently. These two changes required some minor adjustment of the command-line argument parsing code.
This commit is contained in:
@@ -48,12 +48,12 @@ class Command
|
||||
|
||||
void parseOptions(int argc, char **argv)
|
||||
{
|
||||
m_options.parse(argc, argv);
|
||||
const auto parseResult = m_options.parse(argc, argv);
|
||||
|
||||
forEach(m_optionGroups,
|
||||
[&](auto &optionGroup)
|
||||
{
|
||||
optionGroup.parse(m_options);
|
||||
optionGroup.read(parseResult);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ struct OptionGroupBasic
|
||||
static constexpr const auto Name = "basic";
|
||||
|
||||
void addTo(cxxopts::Options &options);
|
||||
void parse(cxxopts::Options &options);
|
||||
void read(const cxxopts::ParseResult &parseResult);
|
||||
|
||||
bool help = false;
|
||||
bool version = false;
|
||||
@@ -44,7 +44,7 @@ struct OptionGroupOutput
|
||||
static constexpr const auto Name = "output";
|
||||
|
||||
void addTo(cxxopts::Options &options);
|
||||
void parse(cxxopts::Options &options);
|
||||
void read(const cxxopts::ParseResult &parseResult);
|
||||
|
||||
colorlog::ColorStream::ColorPolicy colorPolicy = colorlog::ColorStream::ColorPolicy::Auto;
|
||||
colorlog::Priority logPriority = colorlog::Priority::Info;
|
||||
@@ -57,7 +57,7 @@ struct OptionGroupParser
|
||||
static constexpr const auto Name = "parser";
|
||||
|
||||
void addTo(cxxopts::Options &options);
|
||||
void parse(cxxopts::Options &options);
|
||||
void read(const cxxopts::ParseResult &parseResult);
|
||||
|
||||
std::vector<std::string> inputFiles;
|
||||
pddl::Mode parsingMode = pddl::Mode::Strict;
|
||||
|
Reference in New Issue
Block a user