forked from ReVanced/revanced-cli
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
547 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package app.revanced.cli.command | ||
|
||
import app.revanced.cli.logging.impl.DefaultCliLogger | ||
import app.revanced.patcher.patch.PatchClass | ||
import picocli.CommandLine | ||
import picocli.CommandLine.Command | ||
import picocli.CommandLine.IVersionProvider | ||
import java.util.* | ||
|
||
fun main(args: Array<String>) { | ||
CommandLine(Main).execute(*args) | ||
} | ||
|
||
internal typealias PatchList = List<PatchClass> | ||
|
||
internal val logger = DefaultCliLogger() | ||
|
||
object CLIVersionProvider : IVersionProvider { | ||
override fun getVersion(): Array<String> { | ||
Properties().apply { | ||
load(Main::class.java.getResourceAsStream("/app/revanced/cli/version.properties")) | ||
}.let { | ||
return arrayOf("ReVanced CLI v${it.getProperty("version")}") | ||
} | ||
} | ||
} | ||
|
||
@Command( | ||
name = "revanced-cli", | ||
description = ["Command line application to use ReVanced"], | ||
mixinStandardHelpOptions = true, | ||
versionProvider = CLIVersionProvider::class, | ||
subcommands = [ | ||
ListPatchesCommand::class, | ||
PatchCommand::class, | ||
UninstallCommand::class | ||
] | ||
) | ||
internal object Main |
Oops, something went wrong.