SingleValueParsingStrategy
The strategy to use when parsing a single value from @Option
arguments.
struct SingleValueParsingStrategy
The strategy to use when parsing a single value from @Option
arguments.
struct SingleValueParsingStrategy
import ArgumentParser
Straightforward, type-safe argument parsing for Swift.
struct ArrayParsingStrategy
The strategy to use when parsing multiple values from @Option
arguments into an array.
init(name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, completion: CompletionKind? = nil)
Creates a required property that reads its value from a labeled option.
init<T>(name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, completion: CompletionKind? = nil) where Value == T?, T : ExpressibleByArgument
Creates an optional property that reads its value from a labeled option.
init(wrappedValue: Value, name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, completion: CompletionKind? = nil)
Creates a property with a default value that reads its value from a labeled option.
@preconcurrency init(name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, completion: CompletionKind? = nil, transform: @escaping (String) throws -> Value)
Creates a required property that reads its value from a labeled option, parsing with the given closure.
@preconcurrency init<T>(name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, completion: CompletionKind? = nil, transform: @escaping (String) throws -> T) where Value == T?
Creates an optional property that reads its value from a labeled option, parsing with the given closure.
@preconcurrency init(wrappedValue: Value, name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, completion: CompletionKind? = nil, transform: @escaping (String) throws -> Value)
Creates a property with a default value that reads its value from a labeled option, parsing 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 next: SingleValueParsingStrategy { get }
Parse the input after the option. Expect it to be a value.
static var scanningForValue: SingleValueParsingStrategy { get }
Parse the next input, as long as that input can’t be interpreted as an option or flag.
static var unconditional: SingleValueParsingStrategy { get }
Parse the next input, even if it could be interpreted as an option or flag.
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.