Arguments

class Arguments

A type that handles the command line arguments passed to the script.

Note

The arguments will be parsed only if you access to any attribute that require arguments parsing, which is the attributes command, flags and parameters. The arguments are parsed only once.
  • all

    An array with all command line arguments passed to the script.

    Declaration

    Swift

    public let all: [String]
  • Creates an instance with supplied command line arguments, defaults to ProcessInfo.processInfo.arguments.

    Declaration

    Swift

    public init(args: [String] = ProcessInfo.processInfo.arguments)
  • The name of the executable that was invoked from the command line.

    Declaration

    Swift

    public var command: String { get }
  • Parsed flags will be prepared in a dictionary, the key is the flag and the value is the flag value.

    Declaration

    Swift

    public var flags: [String : String] { get }
  • List of parameters passed to the script

    Declaration

    Swift

    public var parameters: [String] { get }