Added help and version options to the translate command.

This commit is contained in:
2017-10-12 17:18:00 +02:00
parent 569b170aba
commit 86486207b8
7 changed files with 306 additions and 211 deletions

View File

@@ -0,0 +1,29 @@
#ifndef __PLASP_APP__COMMANDS_H
#define __PLASP_APP__COMMANDS_H
#include <string>
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Commands
//
////////////////////////////////////////////////////////////////////////////////////////////////////
enum class Command
{
Help,
Version,
CheckSyntax,
Requirements,
PrettyPrint,
Normalize,
Translate
};
////////////////////////////////////////////////////////////////////////////////////////////////////
Command parseCommand(const std::string &commandString);
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif

View File

@@ -1,7 +1,7 @@
#ifndef __PLASP_APP__COMMON_OPTIONS_H
#define __PLASP_APP__COMMON_OPTIONS_H
#include <boost/program_options.hpp>
#include <cxxopts.hpp>
#include <colorlog/ColorStream.h>
#include <colorlog/Priority.h>
@@ -17,10 +17,6 @@
//
////////////////////////////////////////////////////////////////////////////////////////////////////
namespace po = boost::program_options;
////////////////////////////////////////////////////////////////////////////////////////////////////
class OptionException : public pddl::Exception
{
public:
@@ -29,10 +25,9 @@ class OptionException : public pddl::Exception
////////////////////////////////////////////////////////////////////////////////////////////////////
po::options_description basicOptions();
po::options_description outputOptions();
po::options_description parserOptions();
po::positional_options_description parserPositionalOptions();
void addBasicOptions(cxxopts::Options &options);
void addOutputOptions(cxxopts::Options &options);
void addParserOptions(cxxopts::Options &options);
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -62,9 +57,9 @@ struct ParserOptions
////////////////////////////////////////////////////////////////////////////////////////////////////
BasicOptions parseBasicOptions(const po::variables_map &variablesMap);
OutputOptions parseOutputOptions(const po::variables_map &variablesMap);
ParserOptions parseParserOptions(const po::variables_map &variablesMap);
BasicOptions parseBasicOptions(cxxopts::Options &options);
OutputOptions parseOutputOptions(cxxopts::Options &options);
ParserOptions parseParserOptions(cxxopts::Options &options);
////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,6 @@
#ifndef __PLASP_APP__COMMANDS__TRANSLATE_H
#define __PLASP_APP__COMMANDS__TRANSLATE_H
int translate(int argc, char **argv);
#endif