27 lines
614 B
C++
27 lines
614 B
C++
#pragma once
|
|
#include "ActionFile.h"
|
|
#include <map>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <string_view>
|
|
|
|
namespace Bilicraft
|
|
{
|
|
enum class ConsoleKind { Empty, Action, Run, Tasks, Help, Quit, Display };
|
|
struct ConsoleCommand
|
|
{
|
|
ConsoleKind kind = ConsoleKind::Empty;
|
|
std::string argument; // File path for Run, console output for Display.
|
|
std::optional<ActionCommand> action;
|
|
};
|
|
class ConsoleCommandParser
|
|
{
|
|
public:
|
|
ConsoleCommand Parse(std::string_view line);
|
|
|
|
private:
|
|
std::map<std::string, std::string, std::less<>> aliases;
|
|
};
|
|
std::string ConsoleHelp();
|
|
} // namespace Bilicraft
|