File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 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>
You can’t perform that action at this time.
0 commit comments