Nix 2.26.3
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 <functional>
5#include <map>
6#include <string>
7
8namespace nix {
9
10typedef std::function<void(int, char * *)> MainFunction;
11
12struct RegisterLegacyCommand
13{
14 typedef std::map<std::string, MainFunction> Commands;
15 static Commands * commands;
16
17 RegisterLegacyCommand(const std::string & name, MainFunction fun)
18 {
19 if (!commands) commands = new Commands;
20 (*commands)[name] = fun;
21 }
22};
23
24}
std::function< void(Sink &)> fun
Definition lexer.l:3485
const std::string_view & name
Definition lexer.l:1709