Flag

public struct Flag : CommandComponent

A command component that is represents a flag, e.g. --verbose

  • Declaration

    Swift

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

    Declaration

    Swift

    public init(_ name: String, shouldAppend: Bool = true, forceShortFlag: Bool = false)

    Parameters

    name

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

    shouldAppend

    An optional boolean that you can use to control whether the flag should be used or not. Default is true.

    forceShortFlag

    An optional bool that you can use to force a short flag like -verbose (instead of --verbose)