aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.cli/registry.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-07-01 17:07:04 +0100
committerLexi Winter <lexi@le-fay.org>2025-07-01 17:07:04 +0100
commit2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 (patch)
tree54d37ffadf8e677938d9b7a28e4e9b71be1e75c1 /nihil.cli/registry.cc
parent36427c0966faa7aecd586b397ed9b845f18172f5 (diff)
downloadnihil-2e2d1bd3b6c7776b77c33b94f30ead89367a71e6.tar.gz
nihil-2e2d1bd3b6c7776b77c33b94f30ead89367a71e6.tar.bz2
add nihil.std
Diffstat (limited to 'nihil.cli/registry.cc')
-rw-r--r--nihil.cli/registry.cc30
1 files changed, 11 insertions, 19 deletions
diff --git a/nihil.cli/registry.cc b/nihil.cli/registry.cc
index e35078d..0f0041b 100644
--- a/nihil.cli/registry.cc
+++ b/nihil.cli/registry.cc
@@ -1,16 +1,8 @@
-/*
- * This source code is released into the public domain.
- */
-
-module;
-
-#include <cstdio>
-#include <exception>
-#include <memory>
-#include <vector>
-
+// This source code is released into the public domain.
module nihil.cli;
+import nihil.std;
+
namespace nihil {
/*
@@ -22,11 +14,11 @@ try {
static auto commands = std::vector<std::shared_ptr<command_node>>();
return commands;
} catch (std::exception const &exc) {
- std::printf("%s\n", exc.what());
- std::exit(1);
+ std::println(std::cerr, "{}", exc.what());
+ std::exit(1); // NOLINT
} catch (...) {
- std::printf("get_registered_commands(): unknown error\n");
- std::exit(1);
+ std::println(std::cerr, "get_registered_commands(): unknown error\n");
+ std::exit(1); // NOLINT
}
/*
@@ -39,11 +31,11 @@ try {
auto &commands = get_registry();
commands.emplace_back(cmd, null_deleter);
} catch (std::exception const &exc) {
- std::printf("%s\n", exc.what());
- std::exit(1);
+ std::println(std::cerr, "{}", exc.what());
+ std::exit(1); // NOLINT
} catch (...) {
- std::printf("get_registered_commands(): unknown error\n");
- std::exit(1);
+ std::println(std::cerr, "get_registered_commands(): unknown error\n");
+ std::exit(1); // NOLINT
}
/*