fix: Use punctuation in option descriptions

This commit is contained in:
oSumAtrIX 2023-10-08 17:18:09 +02:00
parent df2c137ae9
commit da4469f402
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
4 changed files with 36 additions and 36 deletions

View File

@ -9,41 +9,41 @@ import java.io.File
import java.util.logging.Logger 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 { internal object ListPatchesCommand : Runnable {
private val logger = Logger.getLogger(ListPatchesCommand::class.java.name) private val logger = Logger.getLogger(ListPatchesCommand::class.java.name)
@Parameters( @Parameters(
description = ["Paths to patch bundles"], arity = "1..*" description = ["Paths to patch bundles."], arity = "1..*"
) )
private lateinit var patchBundles: Array<File> private lateinit var patchBundles: Array<File>
@Option( @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 private var withDescriptions: Boolean = true
@Option( @Option(
names = ["-p", "--with-packages"], names = ["-p", "--with-packages"],
description = ["List the packages the patches are compatible with"], description = ["List the packages the patches are compatible with."],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var withPackages: Boolean = false private var withPackages: Boolean = false
@Option( @Option(
names = ["-v", "--with-versions"], 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 showDefaultValue = ALWAYS
) )
private var withVersions: Boolean = false private var withVersions: Boolean = false
@Option( @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 private var withOptions: Boolean = false
@Option( @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 private var packageName: String? = null

View File

@ -26,7 +26,7 @@ private object CLIVersionProvider : IVersionProvider {
@Command( @Command(
name = "revanced-cli", name = "revanced-cli",
description = ["Command line application to use ReVanced"], description = ["Command line application to use ReVanced."],
mixinStandardHelpOptions = true, mixinStandardHelpOptions = true,
versionProvider = CLIVersionProvider::class, versionProvider = CLIVersionProvider::class,
subcommands = [ subcommands = [

View File

@ -10,29 +10,29 @@ import java.util.logging.Logger
@CommandLine.Command( @CommandLine.Command(
name = "options", name = "options",
description = ["Generate options file from patches"], description = ["Generate options file from patches."],
) )
internal object OptionsCommand : Runnable { internal object OptionsCommand : Runnable {
private val logger = Logger.getLogger(OptionsCommand::class.java.name) private val logger = Logger.getLogger(OptionsCommand::class.java.name)
@CommandLine.Parameters( @CommandLine.Parameters(
description = ["Paths to patch bundles"], arity = "1..*" description = ["Paths to patch bundles."], arity = "1..*"
) )
private lateinit var patchBundles: Array<File> private lateinit var patchBundles: Array<File>
@CommandLine.Option( @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") private var filePath: File = File("options.json")
@CommandLine.Option( @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 private var overwrite: Boolean = false
@CommandLine.Option( @CommandLine.Option(
names = ["-u", "--update"], 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 showDefaultValue = ALWAYS
) )
private var update: Boolean = false private var update: Boolean = false

View File

@ -20,7 +20,7 @@ import java.util.logging.Logger
@CommandLine.Command( @CommandLine.Command(
name = "patch", description = ["Patch an APK file"] name = "patch", description = ["Patch an APK file."]
) )
internal object PatchCommand : Runnable { internal object PatchCommand : Runnable {
private val logger = Logger.getLogger(PatchCommand::class.java.name) private val logger = Logger.getLogger(PatchCommand::class.java.name)
@ -35,104 +35,104 @@ internal object PatchCommand : Runnable {
private var patchBundles = emptyList<File>() private var patchBundles = emptyList<File>()
@CommandLine.Option( @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>() private var includedPatches = arrayOf<String>()
@CommandLine.Option( @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>() private var excludedPatches = arrayOf<String>()
@CommandLine.Option( @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") private var optionsFile: File = File("options.json")
@CommandLine.Option( @CommandLine.Option(
names = ["--exclusive"], 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 showDefaultValue = ALWAYS
) )
private var exclusive = false private var exclusive = false
@CommandLine.Option( @CommandLine.Option(
names = ["-f","--force"], 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 showDefaultValue = ALWAYS
) )
private var force: Boolean = false private var force: Boolean = false
@CommandLine.Option( @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 private lateinit var outputFilePath: File
@CommandLine.Option( @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 private var deviceSerial: String? = null
@CommandLine.Option( @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 private var mount: Boolean = false
@CommandLine.Option( @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 private var keystoreFilePath: File? = null
// key store password // key store password
@CommandLine.Option( @CommandLine.Option(
names = ["--keystore-password"], 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 private var keyStorePassword: String? = null // Empty password by default
@CommandLine.Option( @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 showDefaultValue = ALWAYS
) )
private var alias = "ReVanced Key" private var alias = "ReVanced Key"
@CommandLine.Option( @CommandLine.Option(
names = ["--keystore-entry-password"], 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 private var password = "" // Empty password by default
@CommandLine.Option( @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 showDefaultValue = ALWAYS
) )
private var signer = "ReVanced" private var signer = "ReVanced"
@CommandLine.Option( @CommandLine.Option(
names = ["-r", "--resource-cache"], names = ["-r", "--resource-cache"],
description = ["Path to temporary resource cache directory"], description = ["Path to temporary resource cache directory."],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var resourceCachePath = File("revanced-resource-cache") private var resourceCachePath = File("revanced-resource-cache.")
private var aaptBinaryPath: File? = null private var aaptBinaryPath: File? = null
@CommandLine.Option( @CommandLine.Option(
names = ["-p", "--purge"], names = ["-p", "--purge"],
description = ["Purge the temporary resource cache directory after patching"], description = ["Purge the temporary resource cache directory after patching."],
showDefaultValue = ALWAYS showDefaultValue = ALWAYS
) )
private var purge: Boolean = false private var purge: Boolean = false
@CommandLine.Option( @CommandLine.Option(
names = ["-w", "--warn"], 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 showDefaultValue = ALWAYS
) )
private var warn: Boolean = false private var warn: Boolean = false
@CommandLine.Parameters( @CommandLine.Parameters(
description = ["APK file to be patched"], arity = "1..1" description = ["APK file to be patched."], arity = "1..1"
) )
@Suppress("unused") @Suppress("unused")
private fun setApk(apk: File) { private fun setApk(apk: File) {
@ -144,18 +144,18 @@ internal object PatchCommand : Runnable {
} }
@CommandLine.Option( @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") @Suppress("unused")
private fun setIntegrations(integrations: Array<File>) { private fun setIntegrations(integrations: Array<File>) {
integrations.firstOrNull { !it.exists() }?.let { 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 this.integrations += integrations
} }
@CommandLine.Option( @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") @Suppress("unused")
private fun setPatchBundles(patchBundles: Array<File>) { private fun setPatchBundles(patchBundles: Array<File>) {
@ -166,7 +166,7 @@ internal object PatchCommand : Runnable {
} }
@CommandLine.Option( @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") @Suppress("unused")
private fun setAaptBinaryPath(aaptBinaryPath: File) { private fun setAaptBinaryPath(aaptBinaryPath: File) {