7#include <unordered_map>
25DEFINE_FLAG(std::string, rom_file,
"",
"The ROM file to load.");
26DEFINE_FLAG(std::string, bps_file,
"",
"The BPS file to apply.");
29DEFINE_FLAG(std::string, modified_file,
"",
"The modified file.");
31DEFINE_FLAG(std::string, bin_file,
"",
"The binary file to export to.");
32DEFINE_FLAG(std::string, address,
"",
"The address to convert.");
33DEFINE_FLAG(std::string, length,
"",
"The length of the data to read.");
35DEFINE_FLAG(std::string, file_size,
"",
"The size of the file to expand to.");
36DEFINE_FLAG(std::string, dest_rom,
"",
"The destination ROM file.");
38 "The list of tile32 IDs to transfer.");
49 std::vector<std::string> arguments;
50 for (
int i = 2; i < argc; i++) {
51 std::cout <<
"argv[" << i <<
"] = " << argv[i] << std::endl;
52 arguments.emplace_back(argv[i]);
56 std::string mode = argv[1];
60 std::cerr <<
"Invalid mode specified: " << mode << std::endl;
69int main(
int argc,
char *argv[]) {
76 std::cout <<
"Flag: " << flag->
name() <<
" = " << flags->Get() << std::endl;
void Parse(int argc, char **argv)
const std::string & name() const override
#define DECLARE_FLAG(type, name)
#define DEFINE_FLAG(type, name, default_val, help_text)
#define PRINT_IF_ERROR(expression)
#define RETURN_IF_EXCEPTION(expression)
int RunCommandHandler(int argc, char *argv[])
FlagRegistry * global_flag_registry()
Main namespace for the application.
Command handler for the CLI.
std::unordered_map< std::string, std::shared_ptr< CommandHandler > > handlers
int main(int argc, char *argv[])