1
0
mirror of synced 2024-12-15 01:01:15 +01:00
ImHex/lib/libimhex/include/hex/subcommands/subcommands.hpp

33 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
2023-11-10 20:47:08 +01:00
#include <vector>
#include <string>
#include <functional>
namespace hex::subcommands {
2023-11-10 20:47:08 +01:00
/**
* @brief Internal method - takes all the arguments ImHex received from the command line,
* and determine which subcommands to run, with which arguments.
* In some cases, the subcommand or this function directly might exit the program
* (e.g. --help, or when forwarding providers to open to another instance)
* and so this function might not return
*/
void processArguments(const std::vector<std::string> &args);
/**
* @brief Forward the given command to the main instance (might be this instance)
* The callback will be executed after EventImHexStartupFinished
*/
void forwardSubCommand(const std::string &cmdName, const std::vector<std::string> &args);
using ForwardCommandHandler = std::function<void(const std::vector<std::string> &)>;
/**
* @brief Register the handler for this specific command name
*/
void registerSubCommand(const std::string &cmdName, const ForwardCommandHandler &handler);
2023-11-10 20:47:08 +01:00
}