Progress towards REUSE compliance. Change-Id: I0f9d13cb2ceaedab4a1695bd90f57d86ee8cb3e5 Signed-off-by: Raito Bezarius <raito@lix.systems>
29 lines
543 B
C++
29 lines
543 B
C++
// SPDX-FileCopyrightText: 2024 Nix and Lix Authors
|
|
//
|
|
// SPDX-License-Identifier: LGPL-2.1-only
|
|
|
|
#pragma once
|
|
///@file
|
|
|
|
#include <functional>
|
|
#include <map>
|
|
#include <string>
|
|
|
|
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;
|
|
}
|
|
};
|
|
|
|
}
|