1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-07 00:59:57 +00:00

potentially complete events generator

This commit is contained in:
2024-12-06 12:11:54 +06:00
parent 6824f2c992
commit 4343d6d161
6 changed files with 1347 additions and 213 deletions

View File

@@ -24,6 +24,7 @@
* folders: Folders-templates
* -s, --skip: Skip variables setup
* -a, --args: Pass several for several args. Use with syntax `--args a=b` or `-a a=b` to set variable with key `a` to value `b`
* -v, --verbose: Show more verbose output
*/
import java.io.File
@@ -36,6 +37,11 @@ var extensions: List<String>? = null
var skipPrompts: Boolean = false
val commandLineArgs = mutableMapOf<String, String>()
val globalEnvs = System.getenv().toMutableMap()
var verboseMode: Boolean = false
if (args.any { it == "-v" || it == "--verbose" }) {
println(args.joinToString("\n"))
}
fun String.replaceWithVariables(envs: Map<String, String>): String {
var currentString = this
@@ -133,12 +139,19 @@ fun readParameters() {
i++
outputFolder = File(realArgs[i])
}
"--verbose",
"-v" -> {
verboseMode = true
}
"--args",
"-a" -> {
i++
val subarg = realArgs[i]
val key = subarg.takeWhile { it != '=' }
val value = subarg.dropWhile { it != '=' }.removePrefix("=")
if (verboseMode) {
println("Argument $key=$value")
}
commandLineArgs[key] = value
}
"--help",