Add alias command to the interactive console
This commit is contained in:
1 parent
1497f114e6
commit
79ad7114b8
6 files changed
+131
-30
No files matched your search
@@ -1,18 +1,26 @@
|
||||
#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 };
|
||||
enum class ConsoleKind { Empty, Action, Run, Tasks, Help, Quit, Display };
|
||||
struct ConsoleCommand
|
||||
{
|
||||
ConsoleKind kind = ConsoleKind::Empty;
|
||||
std::string path;
|
||||
std::string argument; // File path for Run, console output for Display.
|
||||
std::optional<ActionCommand> action;
|
||||
};
|
||||
ConsoleCommand ParseConsoleCommand(std::string_view line);
|
||||
class ConsoleCommandParser
|
||||
{
|
||||
public:
|
||||
ConsoleCommand Parse(std::string_view line);
|
||||
|
||||
private:
|
||||
std::map<std::string, std::string, std::less<>> aliases;
|
||||
};
|
||||
std::string ConsoleHelp();
|
||||
} // namespace Bilicraft
|
||||
Reference in new issue
Block a user