about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--server/src/main.cpp11
-rw-r--r--src/server/main.cpp25
2 files changed, 25 insertions, 11 deletions
diff --git a/server/src/main.cpp b/server/src/main.cpp
deleted file mode 100644
index 26bee21..0000000
--- a/server/src/main.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <cstdio>
-
-int main(int argc, char* argv[])
-{
-    if (argc != 2) {
-        std::printf("The size of the hash table is needed");
-        return 1;
-    }
-
-    return 0;
-}
diff --git a/src/server/main.cpp b/src/server/main.cpp
new file mode 100644
index 0000000..e04a1cf
--- /dev/null
+++ b/src/server/main.cpp
@@ -0,0 +1,25 @@
+#include <cstdint>
+#include <cstdio>
+#include <stdexcept>
+#include <string>
+
+#include "hashtable.h"
+
+int main(int argc, char* argv[])
+{
+    if (argc != 2) {
+        std::printf("One argument required");
+        return 1;
+    }
+
+    uint32_t size;
+    try {
+        size = std::stoi(std::string(argv[1]));
+    } catch (const std::invalid_argument& e) {
+        std::printf("Invalid argument");
+        return 1;
+    }
+
+
+    return 0;
+}