31 lines
592 B
C++
31 lines
592 B
C++
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <map>
|
|
#include <cstdlib>
|
|
#include <filesystem>
|
|
|
|
namespace sh
|
|
{
|
|
enum class Command
|
|
{
|
|
exit,
|
|
echo,
|
|
type,
|
|
unknown
|
|
};
|
|
|
|
inline const std::map<const std::string_view, const Command>commandMap
|
|
{
|
|
{"exit", Command::exit},
|
|
{"echo", Command::echo},
|
|
{"type", Command::type}
|
|
};
|
|
|
|
Command getCommand(std::string_view input);
|
|
|
|
std::optional<std::string> isExec(const std::string& input);
|
|
|
|
void printType(const std::string& input);
|
|
} |