Repository navigation
π¦ v0.1.3 β Polished CLI APIs & Fancy Output!
π New Features
-
Text Styling Enhancements
- Added
.bold(),.italic(),.underline(),.faint(),.slowBlink(),.rapidBlink(),.reversed(),.conceal(), and.crossedOut()extensions to style your console text easily.
- Added
-
Improved
action {}API- Cleaner, scoped
action { ... }withparam { get(...) }andgetFlag(...)methods for fetching arguments and flags. - Removes the need to manually handle
argsobjects.
- Cleaner, scoped
-
Global Crash Handler
- New
onCrashblock insidekli {}scope for handling uncaught errors in a friendly way.
- New
-
Better Interactive Input
readInputOrNull()now integrates naturally in commands with colored prompts.
ποΈ Deprecations
-
action { args -> }β Deprecated.
β Migrate to the new scopedaction { ... }style for better DX. -
Argstypealias β Deprecated.
β Please useArgsScopefor clearer meaning and future-proofing.
π¨ New Text Styles Available
.faint()β Make the text light..italic()β Italicize the text..underline()β Underline text..slowBlink()β Slow blinking text (where supported)..rapidBlink()β Fast blinking text (where supported)..reversed()β Reverse foreground and background colors..conceal()β Hide the text..crossedOut()β Strike-through the text.
π Migration Example
π΄ Before (v0.1.1):
action { args ->
val name = args.getParams().getOrNull(1)
?: readInputOrNull("Enter your name", AnsiColor.CYAN) ?: "stranger"
val greeting = "Hello, $name"
if (args.getFlag("shout"))
println(greeting.uppercase())
else println(greeting)
}π’ Now (v0.1.3):
action {
val name = param { get("name") ?: readInputOrNull("Enter your name", AnsiColor.CYAN) ?: "stranger" }
val greeting = "Hello, $name".italic().bold().underline()
if (getFlag("shout"))
print(greeting.uppercase(), AnsiColor.rgbHex(0xFF8BF5))
else print(greeting, AnsiColor.rgbHex(0xFF8BF5))
println()
}π₯ Migration Tips
- π Replace
action { args -> }withaction { ... }. - β‘οΈ Switch from
Argsalias βArgsScope. - π¨ Use
.bold(),.italic(),.underline()andprint(..., AnsiColor)for colorful, styled output.
Full Changelog: v0.1.1...v0.1.3