diff options
Diffstat (limited to 'src/main.cc')
| -rw-r--r-- | src/main.cc | 41 |
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; +} |
