Skip to content

Commit 0319d83

Browse files
committed
Improved command description
1 parent c5d52fb commit 0319d83

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

src/main/kotlin/Main.kt

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
import kotlinx.coroutines.CoroutineScope
22
import kotlinx.coroutines.Dispatchers
33
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.*
77
import java.util.concurrent.Callable
88
import kotlin.system.exitProcess
99

10+
1011
data class EnvParameter(
1112
var symbol : String,
1213
var value: String,
1314
var type: String
1415
)
16+
17+
18+
1519
@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+
)
1730
class Checksum : Callable<Int> {
1831

32+
@Spec
33+
var spec: CommandSpec? = null
34+
1935
@Option(names = ["-f", "--file"], description = ["custom simulation configuration file (JSON)"])
2036
var file = ""
2137

@@ -59,6 +75,9 @@ class Checksum : Callable<Int> {
5975
}
6076

6177
environmentParameters = processEnvironmentParameters(parameters)
78+
if(environmentParameters.isNotEmpty()){
79+
println("environment parameters: ${environmentParameters.toString()}")
80+
}
6281

6382
//val fileContents = Files.readAllBytes(file.toPath())
6483
//val digest = MessageDigest.getInstance(port).digest(fileContents)

0 commit comments

Comments
 (0)