Lots of features! Let’s look at just a
couple more
Slide 35
Slide 35 text
Custom Types
Slide 36
Slide 36 text
Multiple Options
Slide 37
Slide 37 text
Nested Commands
Slide 38
Slide 38 text
Prompt for input
val name by option().prompt()
Slide 39
Slide 39 text
Prompt for password
prompt(requireConfirmation = true,
hideInput = true)
Slide 40
Slide 40 text
And much much more
•Choice / Mutually Exclusive / Eager /……Options
•Documenting / Formatting
•Token normalization / Replacing stdin/stdout
•Launch Editor / Bash Autocomplete
•Exception Handing
Slide 41
Slide 41 text
And much much more
Slide 42
Slide 42 text
Why not a Kotlin lib like kotlin-argparse
or kotlinx.cli?
•Lack of subcommand, though that has changed
•Not nearly as feature rich
•Clikt tries to be consistent and intuitive
•Clikt is JVM based
Slide 43
Slide 43 text
Sometimes we have to support scripts
that we would rather not
Slide 44
Slide 44 text
There was a ruby script that did string
interpolation
Slide 45
Slide 45 text
Legacy
Kotlin
Slide 46
Slide 46 text
We can now
•Isolate the legacy code
•Better control on legacy code invocation
•Build new features on our terms
•Refactor and pull code into Kotlin
Slide 47
Slide 47 text
StranglerFig Application
•Martin Fowler ~ 2004
•Create new system around the old
•Gradually move functionality to new
•Less risky way to replace