From 28900729985e6e251e8f1f6e419db8cb5c0e741e Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Thu, 5 Mar 2026 20:41:15 +0100 Subject: [FEAT] Jbuild, Tbuild files for JSON and TOML manifests. Signed-off-by: Amlal El Mahrouss --- src/CommandLine/CLI.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/CommandLine/CLI.cpp') 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 #include +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 \n"; + NeBuild::Logger::info() << "nebuild <{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(); /// report failed build to config. @@ -49,7 +52,7 @@ int main(int argc, char** argv) { constexpr auto kTomlExtension = ".toml"; builder = std::make_unique(); - 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); -- cgit v1.2.3