5#include <unordered_map>
8#include "absl/flags/flag.h"
12ABSL_FLAG(
bool, verbose,
false,
"Enable verbose output");
13ABSL_FLAG(
bool, debug,
false,
"Enable debug output");
31 std::cout << ylw <<
" ▲ " << reset <<
" z3ed\n";
32 std::cout << ylw <<
"▲ ▲ " << reset <<
" by " << mag <<
"scawful\n\n"
34 std::cout <<
"The Legend of " << red <<
"Zelda" << reset
35 <<
": A Link to the Past Hacking Tool\n\n";
36 std::cout << underline;
37 std::cout <<
"Command" << reset <<
" " << underline <<
"Arg"
38 << reset <<
" " << underline <<
"Params\n"
41 std::cout <<
"Apply BPS Patch -a <rom_file> <bps_file>\n";
42 std::cout <<
"Create BPS Patch -c <bps_file> <src_file> "
43 "<modified_file>\n\n";
45 std::cout <<
"Open ROM -o <rom_file>\n";
46 std::cout <<
"Backup ROM -b <rom_file> <optional:new_file>\n";
47 std::cout <<
"Expand ROM -x <rom_file> <file_size>\n\n";
49 std::cout <<
"Transfer Tile16 -t <src_rom> <dest_rom> "
50 "<tile32_id_list:csv>\n\n";
52 std::cout <<
"Export Graphics -e <rom_file> <bin_file>\n";
53 std::cout <<
"Import Graphics -i <bin_file> <rom_file>\n\n";
55 std::cout <<
"SNES to PC Address -s <address>\n";
56 std::cout <<
"PC to SNES Address -p <address>\n";
66 if (std::strcmp(argv[1],
"-h") == 0 || argc == 1) {
71 std::vector<std::string> arguments;
72 for (
int i = 2; i < argc; i++) {
73 std::cout <<
"argv[" << i <<
"] = " << argv[i] << std::endl;
74 arguments.emplace_back(argv[i]);
78 std::string mode = argv[1];
82 std::cerr <<
"Invalid mode specified: " << mode << std::endl;
91int main(
int argc,
char* argv[]) {
92 return yaze::cli::RunCommandHandler(argc, argv);
#define PRINT_IF_ERROR(expression)
int RunCommandHandler(int argc, char *argv[])
Command handler for the CLI.
std::unordered_map< std::string, std::shared_ptr< CommandHandler > > handlers
int main(int argc, char *argv[])
ABSL_FLAG(bool, verbose, false, "Enable verbose output")