Added Include folder

*facepalm*
This commit is contained in:
2025-07-29 15:33:17 +02:00
parent 82abf3c259
commit f54a3ba309
11 changed files with 224 additions and 20 deletions

View File

@ -8,6 +8,10 @@
#include "cmd/cmd_misc.hpp"
#include "cmd/cmd_time.hpp"
#include "cmd/cmd_touch.hpp"
#include "cmd/cmd_truncate.hpp"
#include "cmd/cmd_tr.hpp"
#include "cmd/cmd_prompt.hpp"
#include "cmd/cmd_rm.hpp"
#include "cmd/cmd_wc.hpp"
namespace fsh {
@ -21,7 +25,7 @@ namespace fsh {
}
Command& get(const std::string n) {
if (cmds.find(n) == cmds.end()) { throw std::runtime_error("Command not found"); }
if (cmds.find(n) == cmds.end()) { throw std::runtime_error("Command not found " + n); }
return *(cmds[n]);
}
@ -30,13 +34,17 @@ namespace fsh {
private:
// Nove komande bi registrovali ovde:
CommandRegistry() {
cmds["wc"] = Command::register_cmd<CmdWc>();
cmds["date"] = Command::register_cmd<CmdDate>();
cmds["time"] = Command::register_cmd<CmdTime>();
cmds["echo"] = Command::register_cmd<CmdEcho>();
cmds["exit"] = Command::register_cmd<CmdExit>();
cmds["touch"] = Command::register_cmd<CmdTouch>();
cmds["debug"] = Command::register_cmd<CmdPrintTree>();
cmds["tr"] = Command::register_cmd<CmdTr>();
cmds["rm"] = Command::register_cmd<CmdRM>();
cmds["wc"] = Command::register_cmd<CmdWc>();
cmds["date"] = Command::register_cmd<CmdDate>();
cmds["time"] = Command::register_cmd<CmdTime>();
cmds["echo"] = Command::register_cmd<CmdEcho>();
cmds["exit"] = Command::register_cmd<CmdExit>();
cmds["touch"] = Command::register_cmd<CmdTouch>();
cmds["debug"] = Command::register_cmd<CmdPrintTree>();
cmds["prompt"] = Command::register_cmd<CmdPrompt>();
cmds["truncate"] = Command::register_cmd<CmdTruncate>();
}
std::unordered_map<std::string, std::unique_ptr<Command> > cmds;