Skip to content

Commit 9be3ecd

Browse files
ivmosholgerbrandl
authored andcommitted
Added example without any dependencies
1 parent 6c48a53 commit 9be3ecd

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env kscript
2+
// TODO fill here what your script does
3+
4+
import kotlin.system.exitProcess
5+
6+
class AnsiColors { companion object { const val ANSI_RESET = "\u001B[0m"; const val ANSI_RED = "\u001B[31m"; const val ANSI_GREEN = "\u001B[32m"; const val ANSI_YELLOW = "\u001B[33m"; const val ANSI_BLUE = "\u001B[34m"; const val ANSI_PURPLE = "\u001B[35m"; const val ANSI_CYAN = "\u001B[36m"; const val ANSI_WHITE = "\u001B[37m"; } }
7+
8+
fun logInfo(message: String) = println("${AnsiColors.ANSI_BLUE}$message${AnsiColors.ANSI_RESET}")
9+
fun logWarn(message: String) = println("${AnsiColors.ANSI_YELLOW}$message${AnsiColors.ANSI_RESET}")
10+
fun logError(message: String) = println("${AnsiColors.ANSI_RED}$message${AnsiColors.ANSI_RESET}")
11+
12+
val usage = """
13+
Use this tool to... <TODO>
14+
<TODO> required params info
15+
"""
16+
17+
if (args.size < 2) {
18+
logWarn(usage)
19+
exitProcess(-1)
20+
}
21+
22+
val arg1 = args.get(0)
23+
val arg2 = args.get(1)
24+
25+
// <script>
26+
logInfo("Hello world")
27+
// </script>

0 commit comments

Comments
 (0)