@@ -198,10 +198,17 @@ extension Math.Statistics {
198198 var oneOfFour : String ?
199199
200200 @Argument (
201- completion: . custom { _ in [ " alabaster " , " breakfast " , " crunch " , " crash " ] }
201+ completion: . custom { _, _, _ in
202+ [ " alabaster " , " breakfast " , " crunch " , " crash " ]
203+ }
202204 )
203205 var customArg : String ?
204206
207+ @Argument (
208+ completion: . custom { _ in [ " alabaster " , " breakfast " , " crunch " , " crash " ] }
209+ )
210+ var customDeprecatedArg : String ?
211+
205212 @Argument ( help: " A group of floating-point values to operate on. " )
206213 var values : [ Double ] = [ ]
207214
@@ -222,12 +229,16 @@ extension Math.Statistics {
222229 var directory : String ?
223230
224231 @Option (
225- completion: . shellCommand( " head -100 /usr/share/dict/words | tail -50 " ) )
232+ completion: . shellCommand( " head -100 /usr/share/dict/words | tail -50 " )
233+ )
226234 var shell : String ?
227235
228236 @Option ( completion: . custom( customCompletion) )
229237 var custom : String ?
230238
239+ @Option ( completion: . custom( customDeprecatedCompletion) )
240+ var customDeprecated : String ?
241+
231242 func validate( ) throws {
232243 if testSuccessExitCode {
233244 throw ExitCode . success
@@ -248,7 +259,13 @@ extension Math.Statistics {
248259 }
249260}
250261
251- func customCompletion( _ s: [ String ] ) -> [ String ] {
262+ func customCompletion( _ s: [ String ] , _: Int , _: Int ) -> [ String ] {
263+ ( s. last ?? " " ) . starts ( with: " a " )
264+ ? [ " aardvark " , " aaaaalbert " ]
265+ : [ " hello " , " helicopter " , " heliotrope " ]
266+ }
267+
268+ func customDeprecatedCompletion( _ s: [ String ] ) -> [ String ] {
252269 ( s. last ?? " " ) . starts ( with: " a " )
253270 ? [ " aardvark " , " aaaaalbert " ]
254271 : [ " hello " , " helicopter " , " heliotrope " ]
0 commit comments