@@ -138,12 +138,40 @@ extension Option where Value: ExpressibleByArgument {
138
138
/// - name: A specification for what names are allowed for this flag.
139
139
/// - parsingStrategy: The behavior to use when looking for this option's value.
140
140
/// - help: Information about how to use this option.
141
+ @available ( * , deprecated, message: " Use init(wrappedValue:name:parsing:help:completion:) instead. " )
141
142
public init (
142
143
wrappedValue: Value ,
143
144
name: NameSpecification = . long,
144
145
parsing parsingStrategy: SingleValueParsingStrategy = . next,
145
- completion: CompletionKind ? = nil ,
146
- help: ArgumentHelp ? = nil
146
+ completion: CompletionKind ,
147
+ help: ArgumentHelp
148
+ ) {
149
+ self . init (
150
+ name: name,
151
+ initial: wrappedValue,
152
+ parsingStrategy: parsingStrategy,
153
+ help: help,
154
+ completion: completion)
155
+ }
156
+
157
+ /// Creates a property with a default value provided by standard Swift default value syntax.
158
+ ///
159
+ /// This method is called to initialize an `Option` with a default value such as:
160
+ /// ```swift
161
+ /// @Option var foo: String = "bar"
162
+ /// ```
163
+ ///
164
+ /// - Parameters:
165
+ /// - wrappedValue: A default value to use for this property, provided implicitly by the compiler during property wrapper initialization.
166
+ /// - name: A specification for what names are allowed for this flag.
167
+ /// - parsingStrategy: The behavior to use when looking for this option's value.
168
+ /// - help: Information about how to use this option.
169
+ public init (
170
+ wrappedValue: Value ,
171
+ name: NameSpecification = . long,
172
+ parsing parsingStrategy: SingleValueParsingStrategy = . next,
173
+ help: ArgumentHelp ? = nil ,
174
+ completion: CompletionKind ? = nil
147
175
) {
148
176
self . init (
149
177
name: name,
0 commit comments