Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
legacy.hh
Go to the documentation of this file.
1#pragma once
3
4#include "nix/util/fun.hh"
5
6#include <map>
7#include <string>
8
9namespace nix {
10
11typedef fun<void(int, char **)> MainFunction;
12
13struct RegisterLegacyCommand
14{
15 typedef std::map<std::string, MainFunction> Commands;
16
17 static Commands & commands();
18
19 RegisterLegacyCommand(const std::string & name, MainFunction command)
20 {
21 commands().insert_or_assign(name, command);
22 }
23};
24
25} // namespace nix
Definition fun.hh:19