ArrayParsingStrategy
The strategy to use when parsing multiple values from @Option
arguments into an array.
struct ArrayParsingStrategy
The strategy to use when parsing multiple values from @Option
arguments into an array.
struct ArrayParsingStrategy
import ArgumentParser
Straightforward, type-safe argument parsing for Swift.
init<T>(name: NameSpecification = .long, parsing parsingStrategy: ArrayParsingStrategy = .singleValue, help: ArgumentHelp? = nil, completion: CompletionKind? = nil) where Value == [T], T : ExpressibleByArgument
Creates a required array property that reads its values from zero or more labeled options.
@preconcurrency init<T>(name: NameSpecification = .long, parsing parsingStrategy: ArrayParsingStrategy = .singleValue, help: ArgumentHelp? = nil, completion: CompletionKind? = nil, transform: @escaping (String) throws -> T) where Value == [T]
Creates a required array property that reads its values from zero or more labeled options, parsing each element with the given closure.
init<T>(wrappedValue: Array<T>, name: NameSpecification = .long, parsing parsingStrategy: ArrayParsingStrategy = .singleValue, help: ArgumentHelp? = nil, completion: CompletionKind? = nil) where Value == [T], T : ExpressibleByArgument
Creates an array property that reads its values from zero or more labeled options.
@preconcurrency init<T>(wrappedValue: Array<T>, name: NameSpecification = .long, parsing parsingStrategy: ArrayParsingStrategy = .singleValue, help: ArgumentHelp? = nil, completion: CompletionKind? = nil, transform: @escaping (String) throws -> T) where Value == [T]
Creates an array property that reads its values from zero or more labeled options, parsing each element with the given closure.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
static var remaining: ArrayParsingStrategy { get }
Parse all remaining arguments into an array.
static var singleValue: ArrayParsingStrategy { get }
Parse one value per option, joining multiple into an array.
static var unconditionalSingleValue: ArrayParsingStrategy { get }
Parse the value immediately after the option while allowing repeating options, joining multiple into an array.
static var upToNextOption: ArrayParsingStrategy { get }
Parse all values up to the next option.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.