From 99826c21b9da1c3a74fd8b3ebc08c7f8dbfadd30 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 14 Jan 2025 11:52:02 +0100 Subject: T& Labs's ZKA, Multi-Processor Operating System. Signed-off-by: Amlal El Mahrouss --- public/tools/make_app/src/CLI.cc | 80 -------------------------------- public/tools/make_app/src/CommandLine.cc | 80 ++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 80 deletions(-) delete mode 100644 public/tools/make_app/src/CLI.cc create mode 100644 public/tools/make_app/src/CommandLine.cc (limited to 'public/tools/make_app/src') diff --git a/public/tools/make_app/src/CLI.cc b/public/tools/make_app/src/CLI.cc deleted file mode 100644 index 229645d8..00000000 --- a/public/tools/make_app/src/CLI.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Created on Thu Oct 17 08:00:42 CEST 2024 - * - * Copyright (c) 2024 t& Corporation - */ - -#include -#include - -/// @brief This program makes a framework directory for ZKA OS. - -int main(int argc, char* argv[]) -{ - std::vector files; - - auto ext = kFKExtension; - - for (size_t i = 2UL; i < argc; ++i) - { - if (strcmp(argv[i], "-h") == 0) - { - std::cout << "make_app: Framework/Application Creation Tool.\n"; - std::cout << "make_app: © t& Corporation, All rights reserved.\n"; - - std::cout << "make_app: -app: Application directory.\n"; - std::cout << "make_app: -steps: Steps directory.\n"; - std::cout << "make_app: -fwrk: Framework directory.\n"; - - return EXIT_SUCCESS; - } - - if (strcmp(argv[i], "-app") == 0) - { - ext = kAppExtension; - continue; - } - else if (strcmp(argv[i], "-steps") == 0) - { - ext = kStepsExtension; - continue; - } - else if (strcmp(argv[i], "-fwrk") == 0) - { - ext = kFKExtension; - continue; - } - - files.push_back(argv[i]); - } - - auto path = std::string(argv[1]); - - if (!std::filesystem::exists(path)) - return EXIT_FAILURE; - - std::filesystem::path path_arg = path + ext; - - if (std::filesystem::create_directory(path_arg)) - { - std::filesystem::create_directory(path_arg / kRootDirectory); - std::filesystem::create_directory(path_arg / kExecDirectory); - - for (auto& file : files) - { - std::string file_cpy = file; - - while (file_cpy.find("/") != std::string::npos) - { - file_cpy.erase(0, file_cpy.find("/")); - file_cpy.erase(file_cpy.find("/"), 1); - } - - std::filesystem::copy(path, path_arg / kExecDirectory / file_cpy); - } - - return EXIT_SUCCESS; - } - - return EXIT_FAILURE; -} diff --git a/public/tools/make_app/src/CommandLine.cc b/public/tools/make_app/src/CommandLine.cc new file mode 100644 index 00000000..064b11b1 --- /dev/null +++ b/public/tools/make_app/src/CommandLine.cc @@ -0,0 +1,80 @@ +/* + * Created on Thu Oct 17 08:00:42 CEST 2024 + * + * Copyright (c) 2024 t& Labs + */ + +#include +#include + +/// @brief This program makes a framework directory for ZKA OS. + +int main(int argc, char* argv[]) +{ + std::vector files; + + auto ext = kFKExtension; + + for (size_t i = 2UL; i < argc; ++i) + { + if (strcmp(argv[i], "-h") == 0) + { + std::cout << "make_app: Framework/Application Creation Tool.\n"; + std::cout << "make_app: © t& Labs, All rights reserved.\n"; + + std::cout << "make_app: -app: Application directory.\n"; + std::cout << "make_app: -steps: Steps (Setup pages) directory.\n"; + std::cout << "make_app: -fwrk: Framework directory.\n"; + + return EXIT_SUCCESS; + } + + if (strcmp(argv[i], "-app") == 0) + { + ext = kAppExtension; + continue; + } + else if (strcmp(argv[i], "-steps") == 0) + { + ext = kStepsExtension; + continue; + } + else if (strcmp(argv[i], "-fwrk") == 0) + { + ext = kFKExtension; + continue; + } + + files.push_back(argv[i]); + } + + auto path = std::string(argv[1]); + + if (!std::filesystem::exists(path)) + return EXIT_FAILURE; + + std::filesystem::path path_arg = path + ext; + + if (std::filesystem::create_directory(path_arg)) + { + std::filesystem::create_directory(path_arg / kRootDirectory); + std::filesystem::create_directory(path_arg / kExecDirectory); + + for (auto& file : files) + { + std::string file_cpy = file; + + while (file_cpy.find("/") != std::string::npos) + { + file_cpy.erase(0, file_cpy.find("/")); + file_cpy.erase(file_cpy.find("/"), 1); + } + + std::filesystem::copy(path, path_arg / kExecDirectory / file_cpy); + } + + return EXIT_SUCCESS; + } + + return EXIT_FAILURE; +} -- cgit v1.2.3