diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-17 10:06:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-17 10:06:26 +0100 |
| commit | 76cf9156127bf7f082294a0c7e79f86059fe69ab (patch) | |
| tree | 5070f4695b591780f60b728cc14e624c5a31b5d8 /dev/cli | |
| parent | a8e72e63ee1921d6a85b801d2cdeff3f4872d468 (diff) | |
| parent | c782117221f0b8f0bb018df673f935c1791fee32 (diff) | |
Merge pull request #5 from nekernel-org/dev
release: NeBuild v0.0.7
Diffstat (limited to 'dev/cli')
| -rw-r--r-- | dev/cli/App.cc (renamed from dev/cli/Tool.cc) | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/dev/cli/Tool.cc b/dev/cli/App.cc index 1d49c9f..ca81d4e 100644 --- a/dev/cli/Tool.cc +++ b/dev/cli/App.cc @@ -5,6 +5,7 @@ // ============================================================= // #include <BuildKit/JSONManifestBuilder.h> +#include <BuildKit/TOMLManifestBuilder.h> static bool kFailed = false; static bool kDryRun = false; @@ -16,18 +17,16 @@ int main(int argc, char** argv) { std::string index_path = argv[index]; if (index_path == "-v" || index_path == "--version") { - NeBuild::Logger::info() << "Brought to you by Amlal El Mahrouss for NeKernel.org.\n"; - NeBuild::Logger::info() << "© 2024-2025 Amlal El Mahrouss, all rights reserved.\n"; - + NeBuild::Logger::info() << "NeKernel Build Tool.\n"; NeBuild::Logger::info() - << "Bugs, issues? Check out: https://github.com/nekernel-org/nebuild/issues\n"; + << "Bugs, or issues? Check out: https://github.com/nekernel-org/nebuild/issues\n"; return EXIT_SUCCESS; } else if (index_path == "--dry-run") { kDryRun = true; continue; } else if (index_path == "-h" || index_path == "--help") { - NeBuild::Logger::info() << "Usage: nebuild <file>\n"; + NeBuild::Logger::info() << "usage: nebuild <file>\n"; return EXIT_SUCCESS; } @@ -52,12 +51,20 @@ int main(int argc, char** argv) { return; } } else { - NeBuild::Logger::info() - << "error: file '" << index_path << "' is not a JSON file!" << std::endl; - kFailed = true; - return; + const auto kTomlExtension = ".toml"; + builder = new NeBuild::TOMLManifestBuilder(); + + if (index_path.ends_with(kTomlExtension)) { + goto end; + } else { + NeBuild::Logger::info() + << "error: file '" << index_path << "' is not a JSON file!" << std::endl; + kFailed = true; + return; + } } + end: NeBuild::Logger::info() << "building manifest: " << index_path << std::endl; if (builder && !builder->BuildTarget(index_path, kDryRun)) { |
