chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:33:03 +08:00
commit 5b57521aa1
8226 changed files with 3425766 additions and 0 deletions
@@ -0,0 +1,38 @@
//
// cli_command_handler.hpp
//
// Command execution handlers
//
#pragma once
#include <string>
#include <memory>
#include <map>
namespace mnncli {
struct ParsedCommand;
struct CommandSpec;
// Base interface for command handlers
class ICommandHandler {
public:
virtual ~ICommandHandler() = default;
virtual std::string CommandName() const = 0;
virtual int Handle(const ParsedCommand& cmd) = 0;
virtual const CommandSpec& GetSpec() const = 0;
};
// Dispatcher for command handlers
class CommandDispatcher {
public:
void Register(std::unique_ptr<ICommandHandler> handler);
int Dispatch(const ParsedCommand& cmd);
private:
std::map<std::string, std::unique_ptr<ICommandHandler>> handlers_;
};
} // namespace mnncli