fix: Make CLI ArgGroup non-exclusive to be able to disable and enable patches at the same time

This commit is contained in:
oSumAtrIX 2024-11-05 19:59:09 +01:00
parent 18e56e6ff4
commit 1bb0d13726
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4

View File

@ -29,11 +29,11 @@ internal object PatchCommand : Runnable {
@Spec @Spec
private lateinit var spec: CommandSpec private lateinit var spec: CommandSpec
@ArgGroup(multiplicity = "0..*") @ArgGroup(exclusive = false, multiplicity = "0..*")
private var selection = mutableSetOf<Selection>() private var selection = mutableSetOf<Selection>()
internal class Selection { internal class Selection {
@ArgGroup(exclusive = false, multiplicity = "1") @ArgGroup(exclusive = false)
internal var enabled: EnableSelection? = null internal var enabled: EnableSelection? = null
internal class EnableSelection { internal class EnableSelection {
@ -65,7 +65,7 @@ internal object PatchCommand : Runnable {
internal var options = mutableMapOf<String, Any?>() internal var options = mutableMapOf<String, Any?>()
} }
@ArgGroup(exclusive = false, multiplicity = "1") @ArgGroup(exclusive = false)
internal var disable: DisableSelection? = null internal var disable: DisableSelection? = null
internal class DisableSelection { internal class DisableSelection {
@ -291,7 +291,6 @@ internal object PatchCommand : Runnable {
patcherTemporaryFilesPath, patcherTemporaryFilesPath,
aaptBinaryPath?.path, aaptBinaryPath?.path,
patcherTemporaryFilesPath.absolutePath, patcherTemporaryFilesPath.absolutePath,
true,
), ),
).use { patcher -> ).use { patcher ->
val packageName = patcher.context.packageMetadata.packageName val packageName = patcher.context.packageMetadata.packageName