feat: --include option (#76)

This commit is contained in:
bogadana 2022-07-03 15:49:25 +02:00 committed by GitHub
parent 585d77ce80
commit 57a1e7c27f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -57,6 +57,9 @@ internal object MainCommand : Runnable {
@Option(names = ["-e", "--exclude"], description = ["Explicitly exclude patches"]) @Option(names = ["-e", "--exclude"], description = ["Explicitly exclude patches"])
var excludedPatches = arrayOf<String>() var excludedPatches = arrayOf<String>()
@Option(names = ["-i", "--include"], description = ["Include patches"])
var includedPatches = arrayOf<String>()
@Option(names = ["-r", "--resource-patcher"], description = ["Disable patching resources"]) @Option(names = ["-r", "--resource-patcher"], description = ["Disable patching resources"])
var disableResourcePatching: Boolean = false var disableResourcePatching: Boolean = false

View File

@ -30,7 +30,7 @@ fun Patcher.addPatchesFiltered(
if (excludePatches && args.excludedPatches.contains(patchName)) { if (excludePatches && args.excludedPatches.contains(patchName)) {
logger.info("$prefix: Explicitly excluded") logger.info("$prefix: Explicitly excluded")
return@patch return@patch
} else if (!patch.include) { } else if (!patch.include && !args.includedPatches.contains(patchName)) {
logger.info("$prefix: Explicitly excluded") logger.info("$prefix: Explicitly excluded")
return@patch return@patch
} }