diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-03-28 21:06:13 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@nekernel.org> | 2025-03-28 21:07:10 +0100 |
| commit | b491f039cee6e585ca4e1dd5d4144e474da8acdf (patch) | |
| tree | 29a1a173b76719abac61d84ae22a74e208a16e59 /cli/CommandLine.cc | |
| parent | f8bf9c5e54224274399af0693477c9b6e6b248e4 (diff) | |
vendor: add: Use rang library now.
cli: fix: always check if builder has been allocated after (presumably)
allocating one.
Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'cli/CommandLine.cc')
| -rw-r--r-- | cli/CommandLine.cc | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/cli/CommandLine.cc b/cli/CommandLine.cc index aedefff..8c93898 100644 --- a/cli/CommandLine.cc +++ b/cli/CommandLine.cc @@ -22,11 +22,10 @@ int main(int argc, char** argv) if (index_path == "-v" || index_path == "--version") { - std::cout << "Usage: btb <file>\n"; - std::cout << "Bugs, Issues?, check out: https://github.com/amlel-el-mahrouss/btb/issues\n"; + logger::info() << "Brought to you by Amlal El Mahrouss for the NeKernel project.\n"; + logger::info() << "© 2024-2025 Amlal El Mahrouss, all rights reserved.\n"; - std::cout << "Brought to you by Amlal El Mahrouss for the NeKernel project.\n"; - std::cout << "© 2024-2025 Amlal El Mahrouss, all rights reserved.\n"; + logger::info() << "Bugs, Issues?, check out: https://github.com/amlel-el-mahrouss/btb/issues\n"; return EXIT_SUCCESS; } @@ -38,7 +37,8 @@ int main(int argc, char** argv) else if (index_path == "-h" || index_path == "--help") { - std::cout << "btb: Build a JSON file: btb <json_path>.json\n"; + logger::info() << "Usage: btb <file>\n"; + return EXIT_SUCCESS; } @@ -50,24 +50,26 @@ int main(int argc, char** argv) if (index_path.ends_with(kJsonExtension)) { builder = new JSONManifestBuilder(); + + if (!builder) + { + kFailed = true; + return; + } } else { - std::cout << "btb: error: file '" << index_path << "' does not end with .json!" << std::endl; + logger::info() << "error: file '" << index_path << "' does not end with .json!" << std::endl; kFailed = true; return; } - std::cout << "btb: building: " << index_path << std::endl; + logger::info() << "building: " << index_path << std::endl; if (builder && !builder->buildTarget(index_path.size(), index_path.c_str(), kDryRun)) { kFailed = true; } - else if (!builder) - { - kFailed = true; - } delete builder; builder = nullptr; |
