forked from lix-project/lix
23 lines
418 B
C++
23 lines
418 B
C++
|
#pragma once
|
||
|
|
||
|
#include <functional>
|
||
|
#include <map>
|
||
|
|
||
|
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;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
}
|