Patrick Lühne
9fde2b8e1b
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.
70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
#ifndef __PLASP_APP__OPTION_GROUPS_H
|
|
#define __PLASP_APP__OPTION_GROUPS_H
|
|
|
|
#include <cxxopts.hpp>
|
|
|
|
#include <colorlog/ColorStream.h>
|
|
#include <colorlog/Priority.h>
|
|
|
|
#include <pddl/Exception.h>
|
|
#include <pddl/Mode.h>
|
|
|
|
#include <plasp/Language.h>
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Option Groups
|
|
//
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
class OptionException : public pddl::Exception
|
|
{
|
|
public:
|
|
using Exception::Exception;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
struct OptionGroupBasic
|
|
{
|
|
static constexpr const auto Name = "basic";
|
|
|
|
void addTo(cxxopts::Options &options);
|
|
void read(const cxxopts::ParseResult &parseResult);
|
|
|
|
bool help = false;
|
|
bool version = false;
|
|
bool warningsAsErrors = false;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
struct OptionGroupOutput
|
|
{
|
|
static constexpr const auto Name = "output";
|
|
|
|
void addTo(cxxopts::Options &options);
|
|
void read(const cxxopts::ParseResult &parseResult);
|
|
|
|
colorlog::ColorStream::ColorPolicy colorPolicy = colorlog::ColorStream::ColorPolicy::Auto;
|
|
colorlog::Priority logPriority = colorlog::Priority::Info;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
struct OptionGroupParser
|
|
{
|
|
static constexpr const auto Name = "parser";
|
|
|
|
void addTo(cxxopts::Options &options);
|
|
void read(const cxxopts::ParseResult &parseResult);
|
|
|
|
std::vector<std::string> inputFiles;
|
|
pddl::Mode parsingMode = pddl::Mode::Strict;
|
|
plasp::Language::Type language = plasp::Language::Type::Automatic;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#endif
|