summaryrefslogtreecommitdiffhomepage
path: root/src/CommandLine/CLI.cpp
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-05 20:41:15 +0100
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-05 20:41:15 +0100
commit28900729985e6e251e8f1f6e419db8cb5c0e741e (patch)
tree01e6fb770c78c2fbbc93d583683fba71d458b5d2 /src/CommandLine/CLI.cpp
parent6dcd04f188b4169a9676abfea825356cba335c2b (diff)
[FEAT] Jbuild, Tbuild files for JSON and TOML manifests.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'src/CommandLine/CLI.cpp')
-rw-r--r--src/CommandLine/CLI.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/CommandLine/CLI.cpp b/src/CommandLine/CLI.cpp
index a21c4ad..22c889b 100644
--- a/src/CommandLine/CLI.cpp
+++ b/src/CommandLine/CLI.cpp
@@ -11,6 +11,9 @@
#include <memory>
#include <thread>
+constexpr auto kNeBuildFileJson = "Jbuild";
+constexpr auto kNeBuildFileToml = "Tbuild";
+
int main(int argc, char** argv) {
if (argc < 1) return EXIT_FAILURE;
@@ -26,7 +29,7 @@ int main(int argc, char** argv) {
config.dry_run(true);
continue;
} else if (index_path == "-h" || index_path == "-help") {
- NeBuild::Logger::info() << "nebuild <options> <file.{json, toml}>\n";
+ NeBuild::Logger::info() << "nebuild <options> <{Jbuild, Tbuild}/file.{json, toml}>\n";
return EXIT_SUCCESS;
}
@@ -37,7 +40,7 @@ int main(int argc, char** argv) {
constexpr auto kJsonExtension = ".json";
- if (index_path.ends_with(kJsonExtension)) {
+ if (index_path.ends_with(kJsonExtension) || index_path == kNeBuildFileJson) {
builder = std::make_unique<NeBuild::JSONManifestBuilder>();
/// report failed build to config.
@@ -49,7 +52,7 @@ int main(int argc, char** argv) {
constexpr auto kTomlExtension = ".toml";
builder = std::make_unique<NeBuild::TOMLManifestBuilder>();
- if (!index_path.ends_with(kTomlExtension)) {
+ if (!index_path.ends_with(kTomlExtension) && index_path != kNeBuildFileToml) {
NeBuild::Logger::info() << "error: file '" << index_path << "' is not a manifest file!"
<< std::endl;
config.has_failed(true);