Skip to content

Commit

Permalink
fix: Use punctuation in option descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Oct 8, 2023
1 parent df2c137 commit da4469f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 36 deletions.
14 changes: 7 additions & 7 deletions src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,41 @@ import java.io.File
import java.util.logging.Logger


@Command(name = "list-patches", description = ["List patches from supplied patch bundles"])
@Command(name = "list-patches", description = ["List patches from supplied patch bundles."])
internal object ListPatchesCommand : Runnable {
private val logger = Logger.getLogger(ListPatchesCommand::class.java.name)

@Parameters(
description = ["Paths to patch bundles"], arity = "1..*"
description = ["Paths to patch bundles."], arity = "1..*"
)
private lateinit var patchBundles: Array<File>

@Option(
names = ["-d", "--with-descriptions"], description = ["List their descriptions"], showDefaultValue = ALWAYS
names = ["-d", "--with-descriptions"], description = ["List their descriptions."], showDefaultValue = ALWAYS
)
private var withDescriptions: Boolean = true

@Option(
names = ["-p", "--with-packages"],
description = ["List the packages the patches are compatible with"],
description = ["List the packages the patches are compatible with."],
showDefaultValue = ALWAYS
)
private var withPackages: Boolean = false

@Option(
names = ["-v", "--with-versions"],
description = ["List the versions of the apps the patches are compatible with"],
description = ["List the versions of the apps the patches are compatible with."],
showDefaultValue = ALWAYS
)
private var withVersions: Boolean = false

@Option(
names = ["-o", "--with-options"], description = ["List the options of the patches"], showDefaultValue = ALWAYS
names = ["-o", "--with-options"], description = ["List the options of the patches."], showDefaultValue = ALWAYS
)
private var withOptions: Boolean = false

@Option(
names = ["-f", "--filter-package-name"], description = ["Filter patches by package name"]
names = ["-f", "--filter-package-name"], description = ["Filter patches by package name."]
)
private var packageName: String? = null

Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/app/revanced/cli/command/MainCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private object CLIVersionProvider : IVersionProvider {

@Command(
name = "revanced-cli",
description = ["Command line application to use ReVanced"],
description = ["Command line application to use ReVanced."],
mixinStandardHelpOptions = true,
versionProvider = CLIVersionProvider::class,
subcommands = [
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ import java.util.logging.Logger

@CommandLine.Command(
name = "options",
description = ["Generate options file from patches"],
description = ["Generate options file from patches."],
)
internal object OptionsCommand : Runnable {
private val logger = Logger.getLogger(OptionsCommand::class.java.name)

@CommandLine.Parameters(
description = ["Paths to patch bundles"], arity = "1..*"
description = ["Paths to patch bundles."], arity = "1..*"
)
private lateinit var patchBundles: Array<File>

@CommandLine.Option(
names = ["-p", "--path"], description = ["Path to patch options JSON file"], showDefaultValue = ALWAYS
names = ["-p", "--path"], description = ["Path to patch options JSON file."], showDefaultValue = ALWAYS
)
private var filePath: File = File("options.json")

@CommandLine.Option(
names = ["-o", "--overwrite"], description = ["Overwrite existing options file"], showDefaultValue = ALWAYS
names = ["-o", "--overwrite"], description = ["Overwrite existing options file."], showDefaultValue = ALWAYS
)
private var overwrite: Boolean = false

@CommandLine.Option(
names = ["-u", "--update"],
description = ["Update existing options by adding missing and removing non-existent options"],
description = ["Update existing options by adding missing and removing non-existent options."],
showDefaultValue = ALWAYS
)
private var update: Boolean = false
Expand Down
46 changes: 23 additions & 23 deletions src/main/kotlin/app/revanced/cli/command/PatchCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import java.util.logging.Logger


@CommandLine.Command(
name = "patch", description = ["Patch an APK file"]
name = "patch", description = ["Patch an APK file."]
)
internal object PatchCommand : Runnable {
private val logger = Logger.getLogger(PatchCommand::class.java.name)
Expand All @@ -35,104 +35,104 @@ internal object PatchCommand : Runnable {
private var patchBundles = emptyList<File>()

@CommandLine.Option(
names = ["-i", "--include"], description = ["List of patches to include"]
names = ["-i", "--include"], description = ["List of patches to include."]
)
private var includedPatches = arrayOf<String>()

@CommandLine.Option(
names = ["-e", "--exclude"], description = ["List of patches to exclude"]
names = ["-e", "--exclude"], description = ["List of patches to exclude."]
)
private var excludedPatches = arrayOf<String>()

@CommandLine.Option(
names = ["--options"], description = ["Path to patch options JSON file"], showDefaultValue = ALWAYS
names = ["--options"], description = ["Path to patch options JSON file."], showDefaultValue = ALWAYS
)
private var optionsFile: File = File("options.json")

@CommandLine.Option(
names = ["--exclusive"],
description = ["Only include patches that are explicitly specified to be included"],
description = ["Only include patches that are explicitly specified to be included."],
showDefaultValue = ALWAYS
)
private var exclusive = false

@CommandLine.Option(
names = ["-f","--force"],
description = ["Bypass compatibility checks for the supplied APK's version"],
description = ["Bypass compatibility checks for the supplied APK's version."],
showDefaultValue = ALWAYS
)
private var force: Boolean = false

@CommandLine.Option(
names = ["-o", "--out"], description = ["Path to save the patched APK file to"], required = true
names = ["-o", "--out"], description = ["Path to save the patched APK file to."], required = true
)
private lateinit var outputFilePath: File

@CommandLine.Option(
names = ["-d", "--device-serial"], description = ["ADB device serial to install to"], showDefaultValue = ALWAYS
names = ["-d", "--device-serial"], description = ["ADB device serial to install to."], showDefaultValue = ALWAYS
)
private var deviceSerial: String? = null

@CommandLine.Option(
names = ["--mount"], description = ["Install by mounting the patched APK file"], showDefaultValue = ALWAYS
names = ["--mount"], description = ["Install by mounting the patched APK file."], showDefaultValue = ALWAYS
)
private var mount: Boolean = false

@CommandLine.Option(
names = ["--keystore"], description = ["Path to the keystore to sign the patched APK file with"],
names = ["--keystore"], description = ["Path to the keystore to sign the patched APK file with."],
)
private var keystoreFilePath: File? = null

// key store password
@CommandLine.Option(
names = ["--keystore-password"],
description = ["The password of the keystore to sign the patched APK file with"],
description = ["The password of the keystore to sign the patched APK file with."],
)
private var keyStorePassword: String? = null // Empty password by default

@CommandLine.Option(
names = ["--alias"], description = ["The alias of the key from the keystore to sign the patched APK file with"],
names = ["--alias"], description = ["The alias of the key from the keystore to sign the patched APK file with."],
showDefaultValue = ALWAYS
)
private var alias = "ReVanced Key"

@CommandLine.Option(
names = ["--keystore-entry-password"],
description = ["The password of the entry from the keystore for the key to sign the patched APK file with"]
description = ["The password of the entry from the keystore for the key to sign the patched APK file with."]
)
private var password = "" // Empty password by default

@CommandLine.Option(
names = ["--signer"], description = ["The name of the signer to sign the patched APK file with"],
names = ["--signer"], description = ["The name of the signer to sign the patched APK file with."],
showDefaultValue = ALWAYS
)
private var signer = "ReVanced"

@CommandLine.Option(
names = ["-r", "--resource-cache"],
description = ["Path to temporary resource cache directory"],
description = ["Path to temporary resource cache directory."],
showDefaultValue = ALWAYS
)
private var resourceCachePath = File("revanced-resource-cache")
private var resourceCachePath = File("revanced-resource-cache.")

private var aaptBinaryPath: File? = null

@CommandLine.Option(
names = ["-p", "--purge"],
description = ["Purge the temporary resource cache directory after patching"],
description = ["Purge the temporary resource cache directory after patching."],
showDefaultValue = ALWAYS
)
private var purge: Boolean = false

@CommandLine.Option(
names = ["-w", "--warn"],
description = ["Warn if a patch can not be found in the supplied patch bundles"],
description = ["Warn if a patch can not be found in the supplied patch bundles."],
showDefaultValue = ALWAYS
)
private var warn: Boolean = false

@CommandLine.Parameters(
description = ["APK file to be patched"], arity = "1..1"
description = ["APK file to be patched."], arity = "1..1"
)
@Suppress("unused")
private fun setApk(apk: File) {
Expand All @@ -144,18 +144,18 @@ internal object PatchCommand : Runnable {
}

@CommandLine.Option(
names = ["-m", "--merge"], description = ["One or more DEX files or containers to merge into the APK"]
names = ["-m", "--merge"], description = ["One or more DEX files or containers to merge into the APK."]
)
@Suppress("unused")
private fun setIntegrations(integrations: Array<File>) {
integrations.firstOrNull { !it.exists() }?.let {
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.name} does not exist")
throw CommandLine.ParameterException(spec.commandLine(), "Integrations file ${it.name} does not exist.")
}
this.integrations += integrations
}

@CommandLine.Option(
names = ["-b", "--patch-bundle"], description = ["One or more bundles of patches"], required = true
names = ["-b", "--patch-bundle"], description = ["One or more bundles of patches."], required = true
)
@Suppress("unused")
private fun setPatchBundles(patchBundles: Array<File>) {
Expand All @@ -166,7 +166,7 @@ internal object PatchCommand : Runnable {
}

@CommandLine.Option(
names = ["--custom-aapt2-binary"], description = ["Path to a custom AAPT binary to compile resources with"]
names = ["--custom-aapt2-binary"], description = ["Path to a custom AAPT binary to compile resources with."]
)
@Suppress("unused")
private fun setAaptBinaryPath(aaptBinaryPath: File) {
Expand Down

0 comments on commit da4469f

Please sign in to comment.