diff --git a/.gitignore b/.gitignore index d4cad9f..a9fa037 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ *.app # Visual Studio +.vscode/ .vs/ CMakeSettings.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 52c75a1..a888318 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # codeshaunted - monke # CMakeLists.txt # root CMake file -# Copyright 2022 codeshaunted +# Copyright 2024 codeshaunted # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ cmake_minimum_required(VERSION 3.12) -project(monke VERSION 1.2) +project(monke VERSION 1.3) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) diff --git a/include/monke/pack.hh b/include/monke/pack.hh index fcbfd22..3591cf9 100644 --- a/include/monke/pack.hh +++ b/include/monke/pack.hh @@ -24,8 +24,8 @@ namespace monke { class Pack { public: - static void unpack(std::string_view __input_path, std::string_view __output_path, std::string_view __password); - static void pack(std::string_view __input_path, std::string_view __output_path, std::string_view __password); + static void unpack(std::string_view input_path, std::string_view output_path, std::string_view password); + static void pack(std::string_view input_path, std::string_view output_path, std::string_view password); }; } // namespace monke diff --git a/source/monke/main.cc b/source/monke/main.cc index 157fdca..2bcd504 100644 --- a/source/monke/main.cc +++ b/source/monke/main.cc @@ -1,7 +1,7 @@ // codeshaunted - monke // source/monke/main.cc // contains entry point -// Copyright 2022 codeshaunted +// Copyright 2024 codeshaunted // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ void help() { std::cout << "monke v" << MONKE_VERSION_MAJOR << "." << MONKE_VERSION_MINOR << std::endl; - std::cout << "Copyright 2021 codeshaunted" << std::endl << std::endl; + std::cout << "Copyright 2024 codeshaunted" << std::endl << std::endl; std::cout << "Usage: monke [arguments]" << std::endl << std::endl; std::cout << "Commands:" << std::endl; std::cout << " pack " << std::endl; @@ -42,9 +42,14 @@ int main(int argc, char* argv[]) { return 0; } - monke::Pack::unpack(argv[2], argv[3], argv[4]); - - std::cout << "Unpacked '" << argv[2] << "' with password '" << argv[4] << "' to '" << argv[3] << "'." << std::endl; + // cursed error handling + // at least it doesn't silent fail anymore ¯\_(ツ)_/¯ + try { + monke::Pack::unpack(argv[2], argv[3], argv[4]); + std::cout << "Unpacked '" << argv[2] << "' with password '" << argv[4] << "' to '" << argv[3] << "'." << std::endl; + } catch (...) { + std::cout << "Failed to unpack '" << argv[2] << "' with password '" << argv[4] << "!" << std::endl; + } } else if (!strcmp(argv[1], "pack") || !strcmp(argv[1], "p")) { if (argc != 5) { @@ -52,9 +57,12 @@ int main(int argc, char* argv[]) { return 0; } - monke::Pack::pack(argv[2], argv[3], argv[4]); - - std::cout << "Packed '" << argv[2] << "' with password '" << argv[4] << "' to '" << argv[3] << "'." << std::endl; + try { + monke::Pack::pack(argv[2], argv[3], argv[4]); + std::cout << "Packed '" << argv[2] << "' with password '" << argv[4] << "' to '" << argv[3] << "'." << std::endl; + } catch (...) { + std::cout << "Failed to pack '" << argv[2] << "' with password '" << argv[4] << "!" << std::endl; + } } else { help();