Command-line arguments is part of Short Circuit's Console Program Basics selection.
Scripted main
See also Program name.

For parsing command line arguments intelligently, see Parsing command-line arguments.

Example command line:

myprogram -c "alpha beta" -h "gamma"

fun main(args: Array<String>) {
     println("There are " + args.size + " arguments given.")
     args.forEachIndexed { i, a -> println("The argument #${i+1} is $a and is at index $i") }
}