diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2026-07-29 23:00:12 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-29 17:00:12 -0600 |
| commit | 2b28bcf03bfe7892f7f987690069a1b7414ded3e (patch) | |
| tree | 0380212f3379e895dd31c9a7a8c6cd90e280cfa7 /src/main.cpp | |
| parent | b4b75e6649d66c028f56116f0bf48a119862b1bb (diff) | |
Add option to extract 1 yml (#237)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4145e93..561acca 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -105,6 +105,7 @@ int main(int argc, char* argv[]) { std::string folder; std::string archive; std::string version; + std::string singlePath; ArchiveType otrMode = ArchiveType::None; bool otrModeSelected = false; bool xmlMode = false; @@ -124,9 +125,14 @@ int main(int argc, char* argv[]) { "Set source directory to locate config.yml and asset metadata for processing") ->check(CLI::ExistingDirectory); otr->add_option("-d,--destdir", destdir, "Set destination directory for export"); + otr->add_option("-S,--single", singlePath, + "Extracts 1 yml rather than everything relative to the source directory"); otr->parse_complete_callback([&] { const auto instance = Companion::Instance = new Companion(filename, ArchiveType::OTR, debug, srcdir, destdir); + if (!singlePath.empty()) { + instance->SetSingleYMLPath(singlePath); + } instance->Init(ExportType::Binary); }); @@ -143,11 +149,16 @@ int main(int argc, char* argv[]) { "Additional files to include in the o2r archive (e.g., mods.toml)") ->check(CLI::ExistingFile); o2r->add_option("-u,--version", version, "Version to set in the o2r archive"); + o2r->add_option("-S,--single", singlePath, + "Extracts 1 yml rather than everything relative to the source directory"); o2r->parse_complete_callback([&] { const auto instance = Companion::Instance = new Companion(filename, ArchiveType::O2R, debug, srcdir, destdir); instance->SetAdditionalFiles(additionalFiles); instance->SetVersion(version); + if (!singlePath.empty()) { + instance->SetSingleYMLPath(singlePath); + } instance->Init(ExportType::Binary); }); @@ -160,9 +171,14 @@ int main(int argc, char* argv[]) { "Set source directory to locate config.yml and asset metadata for processing") ->check(CLI::ExistingDirectory); code->add_option("-d,--destdir", destdir, "Set destination directory to place C code to"); + code->add_option("-S,--single", singlePath, + "Extracts 1 yml rather than everything relative to the source directory"); code->parse_complete_callback([&]() { const auto instance = Companion::Instance = new Companion(filename, ArchiveType::None, debug, srcdir, destdir); + if (!singlePath.empty()) { + instance->SetSingleYMLPath(singlePath); + } instance->Init(ExportType::Code); }); |
