Enumeration

CommandLine

Command-line arguments for the current process.

Declaration

@frozen enum CommandLine

Topics

Accessing Arguments

static var arguments: [String]

Access to the swift arguments, also use lazy initialization of static properties to safely initialize the swift arguments.

Accessing Raw Argument Data

static var argc: Int32

Access to the raw argc value from C.

static var unsafeArgv: UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>

Access to the raw argv value from C. Accessing the argument vector through this pointer is unsafe.

See Also

Command Line Input

func readLine(strippingNewline: Bool) -> String?

Returns a string read from standard input through the end of the current line or until EOF is reached.