From 8926f839720471cc86fd4f7c6371d63b8f71b91d Mon Sep 17 00:00:00 2001 From: dacctal <120422854+dacctal@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:56:39 -0500 Subject: initial commit --- src/main.cc | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src/main.cc') 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 +#include +#include + +#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; +} -- cgit v1.2.3