Implemented “beautify” command.

This commit is contained in:
2017-10-14 01:37:40 +02:00
parent 0d5245b48b
commit 89edafb586
6 changed files with 185 additions and 9 deletions

View File

@@ -4,6 +4,7 @@
#include <map>
#include <string>
#include <plasp-app/commands/CommandBeautify.h>
#include <plasp-app/commands/CommandHelp.h>
#include <plasp-app/commands/CommandNormalize.h>
#include <plasp-app/commands/CommandTranslate.h>
@@ -21,7 +22,7 @@ enum class CommandType
Version,
CheckSyntax,
Requirements,
PrettyPrint,
Beautify,
Normalize,
Translate
};
@@ -38,7 +39,7 @@ static const std::map<std::string, CommandType> commandNames =
{"--version", CommandType::Version},
{"check-syntax", CommandType::CheckSyntax},
{"requirements", CommandType::Requirements},
{"pretty-print", CommandType::PrettyPrint},
{"beautify", CommandType::Beautify},
{"normalize", CommandType::Normalize},
{"translate", CommandType::Translate},
};
@@ -58,7 +59,7 @@ const auto parseCommandType =
////////////////////////////////////////////////////////////////////////////////////////////////////
using AvailableCommands = std::tuple<CommandTranslate, CommandNormalize, CommandHelp, CommandVersion>;
using AvailableCommands = std::tuple<CommandTranslate, CommandNormalize, CommandBeautify, CommandHelp, CommandVersion>;
////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -0,0 +1,25 @@
#ifndef __PLASP_APP__COMMANDS__COMMAND_BEAUTIFY_H
#define __PLASP_APP__COMMANDS__COMMAND_BEAUTIFY_H
#include <plasp-app/Command.h>
#include <plasp-app/OptionGroups.h>
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Command Beautify
//
////////////////////////////////////////////////////////////////////////////////////////////////////
class CommandBeautify : public Command<CommandBeautify, OptionGroupBasic, OptionGroupOutput, OptionGroupParser>
{
public:
static constexpr auto Name = "beautify";
static constexpr auto Description = "Cleanly format PDDL specifications";
public:
int run(int argc, char **argv);
};
////////////////////////////////////////////////////////////////////////////////////////////////////
#endif