Skip to content

Commit

Permalink
fix: Make CLI ArgGroup non-exclusive to be able to disable and enable…
Browse files Browse the repository at this point in the history
… patches at the same time
  • Loading branch information
oSumAtrIX committed Nov 5, 2024
1 parent 18e56e6 commit 1bb0d13
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/kotlin/app/revanced/cli/command/PatchCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ internal object PatchCommand : Runnable {
@Spec
private lateinit var spec: CommandSpec

@ArgGroup(multiplicity = "0..*")
@ArgGroup(exclusive = false, multiplicity = "0..*")
private var selection = mutableSetOf<Selection>()

internal class Selection {
@ArgGroup(exclusive = false, multiplicity = "1")
@ArgGroup(exclusive = false)
internal var enabled: EnableSelection? = null

internal class EnableSelection {
Expand Down Expand Up @@ -65,7 +65,7 @@ internal object PatchCommand : Runnable {
internal var options = mutableMapOf<String, Any?>()
}

@ArgGroup(exclusive = false, multiplicity = "1")
@ArgGroup(exclusive = false)
internal var disable: DisableSelection? = null

internal class DisableSelection {
Expand Down Expand Up @@ -291,7 +291,6 @@ internal object PatchCommand : Runnable {
patcherTemporaryFilesPath,
aaptBinaryPath?.path,
patcherTemporaryFilesPath.absolutePath,
true,
),
).use { patcher ->
val packageName = patcher.context.packageMetadata.packageName
Expand Down

0 comments on commit 1bb0d13

Please sign in to comment.