update README to match changes
This commit is contained in:
12
README.md
12
README.md
@@ -21,29 +21,25 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("com.infendro:cli:1.3.0")
|
||||
implementation("com.infendro:cli:1.3.1")
|
||||
}
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```kotlin
|
||||
import com.infendro.cli.argument.stringOrElse
|
||||
import com.infendro.cli.argument.stringOrNull
|
||||
import com.infendro.cli.command.cli
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
// declare root command
|
||||
cli {
|
||||
execute {
|
||||
// execution of root command (e.g., display help)
|
||||
// execution of root command (e.g., display help)
|
||||
}
|
||||
|
||||
// declare command "test"
|
||||
command("test") {
|
||||
// declare arguments
|
||||
val greetingArg = stringOrElse("greeting", "Hello")
|
||||
val nameArg = stringOrNull("name")
|
||||
val greetingArg = stringOrElse("greeting", "greet", "g", other = "Hello")
|
||||
val nameArg = stringOrNull("name", "n")
|
||||
|
||||
execute {
|
||||
// retrieve the arguments
|
||||
|
||||
Reference in New Issue
Block a user