aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
authordacctal <120422854+dacctal@users.noreply.github.com>2026-01-21 23:56:39 -0500
committerdacctal <120422854+dacctal@users.noreply.github.com>2026-01-21 23:56:39 -0500
commit8926f839720471cc86fd4f7c6371d63b8f71b91d (patch)
treec14523954085f7b6c428a488f81bfb645dcd2c83 /src/main.cc
parent8fc3b1f6cd1062e15c0aed60a110fb91143cd801 (diff)
initial commit
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc41
1 files changed, 40 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc
index b920482..c020c87 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -1 +1,40 @@
-#include penis
+#include <string>
+#include <cstring>
+#include <filesystem>
+
+#include "create_pkg.cc"
+#include "help.cc"
+#include "setup_pkgit.cc"
+#include "install_pkg.cc"
+
+int main(int argc, char *argv[]) {
+ setup_pkgit();
+ Pkg pkg;
+
+ if (argv[1]) {
+ if (strcmp(argv[1], "build") == 0 || strcmp(argv[1], "b") == 0) {
+ if (argv[2]) {
+ build_pkg(argv[2]);
+ } else {
+ build_pkg(fs::current_path().string());
+ }
+ } else if (strcmp(argv[1], "install") == 0 || strcmp(argv[1], "i") == 0) {
+ pkg = create_pkg(argv[2]);
+ if (argv[2]) {
+ install_pkg(pkg);
+ } else {
+ std::cout << print_error << "Not enough arguments! Try: `pkgit install [url]`";
+ }
+ } else if (strcmp(argv[1], "help") == 0 || strcmp(argv[1], "h") == 0) {
+ help();
+ } else if (strcmp(argv[1], "type") == 0) {
+ link_install(fs::current_path().string());
+ } else {
+ help();
+ }
+ } else {
+ help();
+ }
+
+ return 0;
+}