aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.cli/command_node.cc
diff options
context:
space:
mode:
authorLexi Winter <lexi@le-fay.org>2025-07-01 19:18:42 +0100
committerLexi Winter <lexi@le-fay.org>2025-07-01 19:18:42 +0100
commit378dd663a402fe196f2b56c6413eb3f623aecbbf (patch)
tree6d13f14ff8f9bff7c55a30eb046af489d0f677a2 /nihil.cli/command_node.cc
parent2e2d1bd3b6c7776b77c33b94f30ead89367a71e6 (diff)
downloadnihil-378dd663a402fe196f2b56c6413eb3f623aecbbf.tar.gz
nihil-378dd663a402fe196f2b56c6413eb3f623aecbbf.tar.bz2
cli: refactoring
Diffstat (limited to 'nihil.cli/command_node.cc')
-rw-r--r--nihil.cli/command_node.cc40
1 files changed, 0 insertions, 40 deletions
diff --git a/nihil.cli/command_node.cc b/nihil.cli/command_node.cc
deleted file mode 100644
index 5936b8c..0000000
--- a/nihil.cli/command_node.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// This source code is released into the public domain.
-module;
-
-#include <unistd.h> // _exit
-
-module nihil.cli;
-
-import nihil.std;
-import nihil.core;
-import nihil.error;
-
-namespace nihil {
-
-//NOLINTNEXTLINE(bugprone-exception-escape)
-command_node::command_node(std::string_view path) noexcept
-try : m_path(path)
-{
-} catch (std::exception const &exc) {
- std::print(std::cerr, "%s\n", exc.what());
- _exit(1);
- /*NOTREACHED*/
-}
-
-command_node::~command_node() = default;
-
-auto command_node::path(this command_node const &self) noexcept
- -> std::string_view
-{
- return self.m_path;
-}
-
-auto command_node::invoke(int, char **) const
- -> std::expected<int, error>
-{
- // If invoke() wasn't overridden, then this is an empty node,
- // so the command was incomplete.
- return std::unexpected(error(errc::incomplete_command));
-}
-
-} // namespace nihil