Skip to content

Commit

Permalink
feat: --include option (ReVanced#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
bogadana committed Jul 3, 2022
1 parent 585d77c commit 57a1e7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/main/kotlin/app/revanced/cli/command/MainCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ internal object MainCommand : Runnable {
@Option(names = ["-e", "--exclude"], description = ["Explicitly exclude patches"])
var excludedPatches = arrayOf<String>()

@Option(names = ["-i", "--include"], description = ["Include patches"])
var includedPatches = arrayOf<String>()

@Option(names = ["-r", "--resource-patcher"], description = ["Disable patching resources"])
var disableResourcePatching: Boolean = false

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/utils/patcher/Patcher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun Patcher.addPatchesFiltered(
if (excludePatches && args.excludedPatches.contains(patchName)) {
logger.info("$prefix: Explicitly excluded")
return@patch
} else if (!patch.include) {
} else if (!patch.include && !args.includedPatches.contains(patchName)) {
logger.info("$prefix: Explicitly excluded")
return@patch
}
Expand Down

0 comments on commit 57a1e7c

Please sign in to comment.