aboutsummaryrefslogtreecommitdiffstats
path: root/nihil.cli/registry.ccm
blob: 0b9754dc59f27e3ac3f55665edd934fd7c45d0bf (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
/*
 * This source code is released into the public domain.
 */

module;

#include <memory>
#include <span>

export module nihil.cli:registry;

namespace nihil {

export struct command;
export struct command_node;

/*
 * Register a command.  This is guaranteed not to throw; errors will print
 * a diagnostic and exit.
 */
auto register_command(command *cmd) noexcept -> void;

/*
 * Get previously registered commands.
 */
auto get_registered_commands() -> std::span<std::shared_ptr<command_node>>;

} // namespace nihil