blob: 98aeac1a4154151cf4a6f8186cdd63cfd78d7fab (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
/*
* This source code is released into the public domain.
*/
module;
#include <expected>
#include <iostream>
#include <print>
#include <string>
module nihil.cli;
import nihil.core;
import nihil.error;
namespace nihil {
command_node::command_node(std::string_view path) noexcept
: m_path(path)
{
}
command_node::~command_node()
{
}
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
|