From da4469f402c26ad95898404236b0acf0202907e2 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sun, 8 Oct 2023 17:18:09 +0200 Subject: [PATCH] fix: Use punctuation in option descriptions --- .../cli/command/ListPatchesCommand.kt | 14 +++--- .../app/revanced/cli/command/MainCommand.kt | 2 +- .../revanced/cli/command/OptionsCommand.kt | 10 ++-- .../app/revanced/cli/command/PatchCommand.kt | 46 +++++++++---------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt b/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt index c899aa2e..3c3aac24 100644 --- a/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/ListPatchesCommand.kt @@ -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 @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 diff --git a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt index d8bf6d98..5dd7f8dd 100644 --- a/src/main/kotlin/app/revanced/cli/command/MainCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/MainCommand.kt @@ -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 = [ diff --git a/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt b/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt index 82ca0267..bbf5fef4 100644 --- a/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/OptionsCommand.kt @@ -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 @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 diff --git a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt index 6c5ecb9a..53e04b59 100644 --- a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt @@ -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) @@ -35,104 +35,104 @@ internal object PatchCommand : Runnable { private var patchBundles = emptyList() @CommandLine.Option( - names = ["-i", "--include"], description = ["List of patches to include"] + names = ["-i", "--include"], description = ["List of patches to include."] ) private var includedPatches = arrayOf() @CommandLine.Option( - names = ["-e", "--exclude"], description = ["List of patches to exclude"] + names = ["-e", "--exclude"], description = ["List of patches to exclude."] ) private var excludedPatches = arrayOf() @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) { @@ -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) { 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) { @@ -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) {