diff --git a/src/command.h b/src/command.h index 0a16b8c..c6d35e8 100644 --- a/src/command.h +++ b/src/command.h @@ -43,6 +43,14 @@ public: void execute(int argc, char *argv[]) { + + if (argc < 2) + { + std::cout << "Command not found" << std::endl; + throw lpstd::exceptions::ParameterException("argc < 2"); + return; + } + std::string command = argv[1]; std::vector args; for (int i = 2; i < argc; i++) diff --git a/src/commands.h b/src/commands.h index 9b74c2a..25c487f 100644 --- a/src/commands.h +++ b/src/commands.h @@ -6,7 +6,7 @@ using namespace lpstd::exceptions; - namespace commands +namespace commands { void add(int argc, char *argv[]) {