diff options
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; +} |
