blob: 546eb468a7007a8eb45ce7c3b0bf34c7ebdd2b43 (
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
|
/*
* This source code is released into the public domain.
*/
module;
/*
* command_node represents a possibly-invocable command.
*/
#include <expected>
#include <string>
export module nihil.cli:command_node;
import nihil.error;
namespace nihil {
export struct command_node {
command_node(std::string_view path) noexcept;
virtual ~command_node();
[[nodiscard]] auto path(this command_node const &) noexcept
-> std::string_view;
[[nodiscard]] virtual auto invoke(int argc, char **argv) const
-> std::expected<int, error>;
private:
std::string m_path;
};
} // namespace nihil
|