summaryrefslogtreecommitdiffhomepage
path: root/dev/cli
diff options
context:
space:
mode:
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)) {