2016-02-09 21:28:29 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <map>
|
2016-03-15 12:11:27 +01:00
|
|
|
#include <string>
|
2016-02-09 21:28:29 +01:00
|
|
|
|
|
|
|
namespace nix {
|
|
|
|
|
|
|
|
typedef std::function<void(int, char * *)> MainFunction;
|
|
|
|
|
|
|
|
struct RegisterLegacyCommand
|
|
|
|
{
|
|
|
|
typedef std::map<std::string, MainFunction> Commands;
|
|
|
|
static Commands * commands;
|
|
|
|
|
|
|
|
RegisterLegacyCommand(const std::string & name, MainFunction fun)
|
|
|
|
{
|
|
|
|
if (!commands) commands = new Commands;
|
|
|
|
(*commands)[name] = fun;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|