Skip to content

Commit fdc0d49

Browse files
authored
Wrapped two code snippets into triple backquotes
1 parent 4612b02 commit fdc0d49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,20 +131,24 @@ methods mentioned above are, in fact, convenience methods built on top of the
131131

132132
For example, it is possible to create an option that has multiple arguments:
133133

134+
```kotlin
134135
fun ArgParser.putting(vararg names: String, help: String) =
135136
option<MutableMap<String, String>>(*names,
136137
argNames = listOf("KEY", "VALUE"),
137138
help = help) {
138139
value.orElse { mutableMapOf<String, String>() }.apply {
139140
put(arguments.first(), arguments.last()) }
140141
}
142+
```
141143

142144
Note that the `option` method does not have an auto-naming overload. If you
143145
need this capability, create a `DelegateProvider` that creates your `Delegate`:
144146

147+
```kotlin
145148
fun ArgParser.putting(help: String) =
146149
ArgParser.DelegateProvider { identifier ->
147150
putting(identifierToOptionName(identifier), help = help) }
151+
```
148152

149153

150154
## Positional Arguments

0 commit comments

Comments
 (0)