2016-02-09 20:28:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|