Website Summary Files Commits Branches @commit @diff @stats
path: root / src / ConsoleInterface / Command.cpp
diff options
context:
space:
mode:
1 files changed, 4 insertions, 1 deletions
-rw-r--r--src/ConsoleInterface/Command.cpp5
diff --git a/src/ConsoleInterface/Command.cpp b/src/ConsoleInterface/Command.cpp
index da8915f..d3d058c 100644
--- a/src/ConsoleInterface/Command.cpp
+++ b/src/ConsoleInterface/Command.cpp
@@ -1,13 +1,16 @@
#include "Command.h"
#include <cstring>
+Command::Command() : Command("", nullptr) {}
+
Command::Command(const char* nameInMenu, void (*exec)()) {
strcpy(this->nameInMenu, nameInMenu);
this->exec = exec;
}
void Command::run() const {
- exec();
+ if (exec != nullptr)
+ exec();
}
const char* Command::get_nameInMenu() const {