diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-20 05:04:26 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2025-03-20 15:49:00 +0100 |
| commit | e1fd8b63b079d72d31bd7e0ea30fb7695891bc98 (patch) | |
| tree | 56e5feb361683a98527ba92705cd049275252713 /cli/ToolCLI.cc | |
| parent | 271ebdc52e0b9e90381154a29b370bf0be59a611 (diff) | |
META: A bunch of repository update for btb's relevancy.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'cli/ToolCLI.cc')
| -rw-r--r-- | cli/ToolCLI.cc | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/cli/ToolCLI.cc b/cli/ToolCLI.cc deleted file mode 100644 index 01ac73e..0000000 --- a/cli/ToolCLI.cc +++ /dev/null @@ -1,79 +0,0 @@ -// ============================================================= // -// btb -// Copyright (C) 2024, Theater Quality Inc, all rights reserved. -// ============================================================= // - -#include <JSONManifestBuilder.h> -#include <Includes.h> - -static bool kFailed = false; -static bool kDryRun = false; - -int main(int argc, char** argv) -{ - if (argc <= 1) - return 1; - - for (size_t index = 1; index < argc; ++index) - { - std::string index_path = argv[index]; - - if (index_path == "-v" || - index_path == "--version") - { - std::cout << "Usage: btb <file>\n"; - std::cout << "Check for issues at: el-mahrouss-logic.com/developer/issues\n"; - - std::cout << "Brought to you by Theater Quality Inc.\n"; - std::cout << "© Theater Quality Inc, all rights reserved.\n"; - - return 0; - } - else if (index_path == "--dry-run") - { - kDryRun = true; - continue; - } - else if (index_path == "-h" || - index_path == "--help") - { - std::cout << "btb: Build a JSON file: btb <json_path>.json\n"; - - return 0; - } - - std::thread job_build_thread([](std::string index_path) -> void { - IManifestBuilder* builder = nullptr; - - const auto kJsonExtension = ".json"; - - if (index_path.ends_with(kJsonExtension)) - { - builder = new JSONManifestBuilder(); - } - else - { - kFailed = true; - return; - } - - std::cout << "btb: building: " << index_path << std::endl; - - if (builder && !builder->buildTarget(index_path.size(), index_path.c_str(), kDryRun)) - { - kFailed = true; - } - else if (!builder) - { - kFailed = true; - } - - delete builder; - builder = nullptr; - }, index_path); - - job_build_thread.join(); - } - - return kFailed ? EXIT_FAILURE : EXIT_SUCCESS; -} |
