2016-02-09 20:28:29 +00:00
|
|
|
#pragma once
|
2023-04-01 03:18:41 +00:00
|
|
|
///@file
|
2016-02-09 20:28:29 +00:00
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <map>
|
2016-03-15 11:11:27 +00:00
|
|
|
#include <string>
|
2016-02-09 20:28:29 +00:00
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
typedef std::function<void(int, char * *)> MainFunction;
|
|
|
|
|
2024-09-10 20:13:19 +00:00
|
|
|
struct LegacyCommands
|
2016-02-09 20:28:29 +00:00
|
|
|
{
|
|
|
|
typedef std::map<std::string, MainFunction> Commands;
|
|
|
|
static Commands * commands;
|
|
|
|
|
2024-09-10 20:13:19 +00:00
|
|
|
static void add(const std::string & name, MainFunction fun)
|
2016-02-09 20:28:29 +00:00
|
|
|
{
|
|
|
|
if (!commands) commands = new Commands;
|
|
|
|
(*commands)[name] = fun;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|