diff options
| author | AltoXorg <56553686+Alto1772@users.noreply.github.com> | 2025-07-23 23:37:30 +0800 |
|---|---|---|
| committer | Lywx <kiritodev01@gmail.com> | 2025-07-25 09:59:11 -0600 |
| commit | 87c6faae7e8fb00eba9b6d96d5ca1ae0e938e5b1 (patch) | |
| tree | e21d539935b0006d1455463cdf98e11da1d030bd /src/main.cpp | |
| parent | e93d95457ebb337dfeced69ffd1f28dc0b9fbf02 (diff) | |
Add configurable src and dest paths
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main.cpp b/src/main.cpp index 23b80ff..afb3536 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,9 +20,14 @@ int main(int argc, char *argv[]) { bool otrModeSelected = false; bool xmlMode = false; bool debug = false; + std::string srcdir; + std::string destdir app.require_subcommand(); + app.add_option("-s", "--srcdir", srcdir, "Set source directory to locate config.yml, asset metadata, and modding files for importing"); + app.add_option("-d", "--destdir", destdir, "Set destination directory for exporting and generating binaries and source code"); + /* Generate an OTR */ const auto otr = app.add_subcommand("otr", "OTR - Generates an otr\n"); @@ -30,7 +35,7 @@ int main(int argc, char *argv[]) { otr->add_flag("-v,--verbose", debug, "Verbose Debug Mode"); otr->parse_complete_callback([&] { - const auto instance = Companion::Instance = new Companion(filename, ArchiveType::OTR, debug); + const auto instance = Companion::Instance = new Companion(filename, ArchiveType::OTR, debug, srcdir, destdir); instance->Init(ExportType::Binary); }); @@ -41,7 +46,7 @@ int main(int argc, char *argv[]) { o2r->add_flag("-v,--verbose", debug, "Verbose Debug Mode"); o2r->parse_complete_callback([&] { - const auto instance = Companion::Instance = new Companion(filename, ArchiveType::O2R, debug); + const auto instance = Companion::Instance = new Companion(filename, ArchiveType::O2R, debug, srcdir, destdir); instance->Init(ExportType::Binary); }); @@ -52,7 +57,7 @@ int main(int argc, char *argv[]) { code->add_flag("-v,--verbose", debug, "Verbose Debug Mode; adds offsets to C code"); code->parse_complete_callback([&]() { - const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug); + const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug, srcdir, destdir); instance->Init(ExportType::Code); }); @@ -62,7 +67,7 @@ int main(int argc, char *argv[]) { binary->add_option("<baserom.z64>", filename, "")->required()->check(CLI::ExistingFile); binary->parse_complete_callback([&] { - const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug); + const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug, srcdir, destdir); instance->Init(ExportType::Binary); }); @@ -80,7 +85,7 @@ int main(int argc, char *argv[]) { otrMode = ArchiveType::None; } - const auto instance = Companion::Instance = new Companion(filename, otrMode, debug); + const auto instance = Companion::Instance = new Companion(filename, otrMode, debug, srcdir, destdir); instance->Init(ExportType::Header); }); @@ -128,7 +133,7 @@ int main(int argc, char *argv[]) { otrMode = ArchiveType::None; } - const auto instance = Companion::Instance = new Companion(filename, otrMode, debug, true); + const auto instance = Companion::Instance = new Companion(filename, otrMode, debug, true, srcdir, destdir); if (mode == "code") { instance->Init(ExportType::Code); } else if (mode == "otr" || mode == "o2r") { @@ -144,7 +149,7 @@ int main(int argc, char *argv[]) { modding_export->add_option("<baserom.z64>", filename, "")->required()->check(CLI::ExistingFile); modding_export->parse_complete_callback([&] { - const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug); + const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug, srcdir, destdir); if (xmlMode) { instance->Init(ExportType::XML); } else { @@ -166,4 +171,4 @@ int main(int argc, char *argv[]) { return 0; } -#endif
\ No newline at end of file +#endif |
