summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/cli/main.cc11
-rw-r--r--src/lib/JSONManifestBuilder.cc1
-rw-r--r--src/lib/TOMLManifestBuilder.cc3
3 files changed, 9 insertions, 6 deletions
diff --git a/src/cli/main.cc b/src/cli/main.cc
index dd2590b..5a10d07 100644
--- a/src/cli/main.cc
+++ b/src/cli/main.cc
@@ -1,6 +1,8 @@
// ============================================================= //
// NeBuild
+// FILE: main.cc
+// PURPOSE: Main Tool Entrypoint.
// Copyright (C) 2024-2025, Amlal El Mahrouss and NeKernel Authors, licensed under BSD-3 license.
// ============================================================= //
@@ -10,7 +12,7 @@
#include <thread>
int main(int argc, char** argv) {
- if (argc <= 1) return EXIT_FAILURE;
+ if (argc < 1) return EXIT_FAILURE;
NeBuild::BuildConfig config;
@@ -19,8 +21,6 @@ int main(int argc, char** argv) {
if (index_path == "-v" || index_path == "-version") {
NeBuild::Logger::info() << "NeBuild (" << NEBUILD_VERSION << ")\n";
- NeBuild::Logger::info() << "Bugs or issues? https://github.com/nekernel-org/nebuild/issues\n";
-
return EXIT_SUCCESS;
} else if (index_path == "-dry-run" || index_path == "-n") {
config.dry_run_ = true;
@@ -36,7 +36,7 @@ int main(int argc, char** argv) {
std::thread job_build_thread([&index_path, &index, &index_cpy, &argc, &argv, &config]() -> void {
std::unique_ptr<NeBuild::IManifestBuilder> builder;
- const auto kJsonExtension = ".json";
+ constexpr auto kJsonExtension = ".json";
if (index_path.ends_with(kJsonExtension)) {
builder = std::make_unique<NeBuild::JSONManifestBuilder>();
@@ -46,7 +46,7 @@ int main(int argc, char** argv) {
return;
}
} else {
- const auto kTomlExtension = ".toml";
+ constexpr auto kTomlExtension = ".toml";
builder = std::make_unique<NeBuild::TOMLManifestBuilder>();
if (!index_path.ends_with(kTomlExtension)) {
@@ -78,5 +78,6 @@ int main(int argc, char** argv) {
job_build_thread.join();
}
+ // check for whether config is valid. if so return failure, or success.
return !config ? EXIT_FAILURE : EXIT_SUCCESS;
}
diff --git a/src/lib/JSONManifestBuilder.cc b/src/lib/JSONManifestBuilder.cc
index e35a783..8cb126f 100644
--- a/src/lib/JSONManifestBuilder.cc
+++ b/src/lib/JSONManifestBuilder.cc
@@ -1,5 +1,6 @@
// ============================================================= //
// NeBuild
+// PURPOSE: JSON support.
// Copyright (C) 2024-2025, Amlal El Mahrouss and NeKernel Authors, licensed under BSD-3 license.
// ============================================================= //
diff --git a/src/lib/TOMLManifestBuilder.cc b/src/lib/TOMLManifestBuilder.cc
index 757f3fc..81814b8 100644
--- a/src/lib/TOMLManifestBuilder.cc
+++ b/src/lib/TOMLManifestBuilder.cc
@@ -1,5 +1,6 @@
// ============================================================= //
// NeBuild
+// PURPOSE: TOML support.
// Copyright (C) 2024-2025, Amlal El Mahrouss and NeKernel Authors, licensed under BSD-3 license.
// ============================================================= //
@@ -115,4 +116,4 @@ bool TOMLManifestBuilder::BuildTarget(BuildConfig& config) {
const std::string_view TOMLManifestBuilder::BuildSystem() {
return "NeBuild (TOML)";
}
-} // namespace NeBuild \ No newline at end of file
+} // namespace NeBuild