CommandLine

extension CommandLine
  • Parse the command line arguments to get the settings for this execution context.

    Declaration

    Swift

    static func parse() -> CommandLineArguments

    Return Value

    A structure that contains the argument data.

  • Parse the command line arguments to get the settings for this execution context.

    Declaration

    Swift

    static func parse(_ arguments: [String]) -> CommandLineArguments

    Parameters

    arguments

    The list of arguments to parse.

    Return Value

    A structure that contains the argument data.

  • Get the resulting value of a passed argument.

    Declaration

    Swift

    static func getArgument(of flag: String) -> String?

    Parameters

    flag

    The argument to get the value of.

    Return Value

    The string value from the argument, or nil if it doesn’t exit.

  • Get the resulting value of a passed argument.

    Declaration

    Swift

    static func getArgument(of flag: String, from args: [String]) -> String?

    Parameters

    flag

    The argument to get the value of.

    args

    The list of arguments to retrieve values from.

    Return Value

    The string value from the argument, or nil if it doesn’t exit.