Option

public struct Option : CommandComponent

A command component that is represents an option, e.g. --theme full-width

  • Declaration

    Swift

    public var stringRepresentation: String? { get }
  • Initialises a new Flag instance

    Declaration

    Swift

    public init(_ name: String, value: Any?, forceShortOption: Bool = false)

    Parameters

    name

    The name of the flag. You don’t need to inlcude dashes here, they will be added automatically

    value

    The value of the flag. If the value is nil, the option will be ignored

    isShortOption

    An optional bool that you can use to force one dash instead of two, like -theme full-width (instead of --theme full-width)