init(wrappedValue:name:parsing:help:completion:)
Creates a property with a default value that reads its value from a labeled option.
init(wrappedValue: Value, name: NameSpecification = .long, parsing parsingStrategy: SingleValueParsingStrategy = .next, help: ArgumentHelp? = nil, completion: CompletionKind? = nil)
Parameters
- wrappedValue
A default value to use for this property, provided implicitly by the compiler during property wrapper initialization.
- name
A specification for what names are allowed for this option.
- parsingStrategy
The behavior to use when looking for this option’s value.
- help
Information about how to use this option.
- completion
The type of command-line completion provided for this option.
This initializer is used when you declare an @Option
-attributed property that has an ExpressibleByArgument
type, providing a default value:
@Option var title: String = "<Title>"