mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2026-04-01 04:10:19 +00:00
16 lines
506 B
Kotlin
16 lines
506 B
Kotlin
package gay.pizza.pork.tool
|
|
|
|
import com.github.ajalt.clikt.core.CliktCommand
|
|
import com.github.ajalt.clikt.parameters.arguments.argument
|
|
import gay.pizza.dough.fs.PlatformFsProvider
|
|
import gay.pizza.pork.parser.AnsiHighlightScheme
|
|
|
|
class HighlightCommand : CliktCommand(help = "Syntax Highlighter", name = "highlight") {
|
|
val path by argument("file")
|
|
|
|
override fun run() {
|
|
val tool = FileTool(PlatformFsProvider.resolve(path))
|
|
print(tool.highlight(AnsiHighlightScheme()).joinToString(""))
|
|
}
|
|
}
|