This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
plasp/app/include/plasp-app/CommonOptions.h

67 lines
1.9 KiB
C++

#ifndef __PLASP_APP__COMMON_OPTIONS_H
#define __PLASP_APP__COMMON_OPTIONS_H
#include <cxxopts.hpp>
#include <colorlog/ColorStream.h>
#include <colorlog/Priority.h>
#include <pddl/Exception.h>
#include <pddl/Mode.h>
#include <plasp/Language.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Common Options
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class OptionException : public pddl::Exception
{
public:
using Exception::Exception;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
void addBasicOptions(cxxopts::Options &options);
void addOutputOptions(cxxopts::Options &options);
void addParserOptions(cxxopts::Options &options);
////////////////////////////////////////////////////////////////////////////////////////////////////
struct BasicOptions
{
bool help = false;
bool version = false;
bool warningsAsErrors = false;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
struct OutputOptions
{
colorlog::ColorStream::ColorPolicy colorPolicy = colorlog::ColorStream::ColorPolicy::Auto;
colorlog::Priority logPriority = colorlog::Priority::Info;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
struct ParserOptions
{
std::vector<std::string> inputFiles;
pddl::Mode parsingMode = pddl::Mode::Strict;
plasp::Language::Type language = plasp::Language::Type::Automatic;
};
////////////////////////////////////////////////////////////////////////////////////////////////////
BasicOptions parseBasicOptions(cxxopts::Options &options);
OutputOptions parseOutputOptions(cxxopts::Options &options);
ParserOptions parseParserOptions(cxxopts::Options &options);
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif