shell/include/shellUtils.h

31 lines
602 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::filesystem::path> isExec(const std::string& input);
void printType(const std::string& input);
}