|
1 | 1 | import kotlinx.coroutines.CoroutineScope
|
2 | 2 | import kotlinx.coroutines.Dispatchers
|
3 | 3 | import picocli.CommandLine
|
4 |
| -import picocli.CommandLine.Command |
5 |
| -import picocli.CommandLine.Option |
6 |
| -import java.util.InvalidPropertiesFormatException |
| 4 | +import picocli.CommandLine.* |
| 5 | +import picocli.CommandLine.Model.CommandSpec |
| 6 | +import java.util.* |
7 | 7 | import java.util.concurrent.Callable
|
8 | 8 | import kotlin.system.exitProcess
|
9 | 9 |
|
| 10 | + |
10 | 11 | data class EnvParameter(
|
11 | 12 | var symbol : String,
|
12 | 13 | var value: String,
|
13 | 14 | var type: String
|
14 | 15 | )
|
| 16 | + |
| 17 | + |
| 18 | + |
15 | 19 | @Command(name = "modbussimulatorcli", mixinStandardHelpOptions = true, version = ["CLI 0.0.99"],
|
16 |
| - description = ["Modbus TCP Simulator"]) |
| 20 | + description = ["Modbus TCP Simulator"], header = [ |
| 21 | +" _ _ _____ _ _", |
| 22 | +" | | | / ____| (_)", |
| 23 | +" _ __ ___ ___ __| | |__ _ _ ___| | | |_", |
| 24 | +"| '_ ` _ \\ / _ \\ / _` | '_ \\| | | / __| | | | |", |
| 25 | +"| | | | | | (_) | (_| | |_) | |_| \\__ \\ |____| | |", |
| 26 | +"|_| |_| |_|\\___/ \\__,_|_.__/ \\__,_|___/\\_____|_|_|", |
| 27 | +"" |
| 28 | +] |
| 29 | +) |
17 | 30 | class Checksum : Callable<Int> {
|
18 | 31 |
|
| 32 | + @Spec |
| 33 | + var spec: CommandSpec? = null |
| 34 | + |
19 | 35 | @Option(names = ["-f", "--file"], description = ["custom simulation configuration file (JSON)"])
|
20 | 36 | var file = ""
|
21 | 37 |
|
@@ -59,6 +75,9 @@ class Checksum : Callable<Int> {
|
59 | 75 | }
|
60 | 76 |
|
61 | 77 | environmentParameters = processEnvironmentParameters(parameters)
|
| 78 | + if(environmentParameters.isNotEmpty()){ |
| 79 | + println("environment parameters: ${environmentParameters.toString()}") |
| 80 | + } |
62 | 81 |
|
63 | 82 | //val fileContents = Files.readAllBytes(file.toPath())
|
64 | 83 | //val digest = MessageDigest.getInstance(port).digest(fileContents)
|
|
0 commit comments