Skip to content

Commit

Permalink
Update helpformat sample
Browse files Browse the repository at this point in the history
  • Loading branch information
ajalt committed Aug 20, 2023
1 parent c1cb7c2 commit 5d92202
Showing 1 changed file with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,16 @@ class Echo(t: Terminal) : CliktCommand(help = "Echo the STRING(s) to standard ou
}
}

class C : CliktCommand() {
val foo by option().prompt(requireConfirmation = true)
override fun run() {
println("foo: $foo")
}
}

fun main(args: Array<String>) {
C().main(args)
val theme = Theme {
// Use ANSI-16 codes for help colors
styles["info"] = TextColors.green
styles["warning"] = TextColors.blue
styles["danger"] = TextColors.magenta
styles["muted"] = TextColors.gray

// Remove the border around code blocks
flags["markdown.code.block.border"] = false
}
Echo(Terminal(theme = theme)).main(args)
}

0 comments on commit 5d92202

Please sign in to comment.