diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-03 22:32:46 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-03 22:32:46 +0200 |
| commit | 65835ae45b44c6abf762961a1fd8c1489e2b9a78 (patch) | |
| tree | 241b090120b4d3b37d94de67ea1db344d2ae94a9 /cli | |
| parent | e631e5c0ceda0301a49a879178ba93c5141dccff (diff) | |
[IMP] Version 1.01: New CLI and new library.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/compile_flags.txt | 2 | ||||
| -rw-r--r-- | cli/tool.cxx | 58 |
2 files changed, 60 insertions, 0 deletions
diff --git a/cli/compile_flags.txt b/cli/compile_flags.txt new file mode 100644 index 0000000..f6d73f3 --- /dev/null +++ b/cli/compile_flags.txt @@ -0,0 +1,2 @@ +-std=c++20 +-I../inc diff --git a/cli/tool.cxx b/cli/tool.cxx new file mode 100644 index 0000000..348d388 --- /dev/null +++ b/cli/tool.cxx @@ -0,0 +1,58 @@ +#include <cstdio> +#include <manifest_builder.hxx> +#include <cstddef> +#include <string> +#include <iostream> +#include <thread> + +int job_index = 0; + +int main(int argc, char** argv) +{ + job_index = argc - 1; + + for (size_t index = 1; index < argc; ++index) + { + std::string index_json = argv[index]; + + if (index_json == "/Ver" || + index_json == "/Version" || + index_json == "/?" || + index_json == "/Help") + { + std::cout << "btb: 🚀 Version 1.01.\n"; + std::cout << "btb: Brought to you by Amlal El Mahrouss.\n"; + std::cout << "btb: © ZKA Technologies, all rights reserved.\n"; + + std::cout << "btb: 🆘 run file: btb <json_path>.json\n"; + + return 0; + } + + std::thread job([](std::string index_json) -> void { + std::cout << "building: " << index_json << std::endl; + + ManifestBuilder builder; + + if (!builder.buildJson(index_json.size(), index_json.c_str())) + { + std::string format = "btb "; + format += index_json; + + perror(format.c_str()); + } + + --job_index; + }, + index_json); + + job.detach(); + } + + // wait for completion of all jobs. + while (job_index) + { + } + + return 0; +} |
