|
17 | 17 |
|
18 | 18 | // MARK: - Collected Result |
19 | 19 |
|
20 | | -/// Run an executable with given parameters asynchronously and returns |
21 | | -/// a `CollectedResult` containing the output of the child process. |
| 20 | +/// Run an executable with given parameters asynchronously and returns a |
| 21 | +/// `CollectedResult` containing the output of the child process. |
22 | 22 | /// - Parameters: |
23 | 23 | /// - executable: The executable to run. |
24 | 24 | /// - arguments: The arguments to pass to the executable. |
25 | 25 | /// - environment: The environment in which to run the executable. |
26 | 26 | /// - workingDirectory: The working directory in which to run the executable. |
27 | | -/// - platformOptions: The platform specific options to use |
28 | | -/// when running the executable. |
| 27 | +/// - platformOptions: The platform-specific options to use when running the executable. |
29 | 28 | /// - input: The input to send to the executable. |
30 | 29 | /// - output: The method to use for redirecting the standard output. |
31 | 30 | /// - error: The method to use for redirecting the standard error. |
32 | | -/// - Returns a CollectedResult containing the result of the run. |
| 31 | +/// - Returns: a `CollectedResult` containing the result of the run. |
33 | 32 | public func run< |
34 | 33 | Input: InputProtocol, |
35 | 34 | Output: OutputProtocol, |
@@ -59,20 +58,19 @@ public func run< |
59 | 58 | ) |
60 | 59 | } |
61 | 60 |
|
62 | | -/// Run an executable with given parameters asynchronously and returns |
63 | | -/// a `CollectedResult` containing the output of the child process. |
| 61 | +#if SubprocessSpan |
| 62 | +/// Run an executable with given parameters asynchronously and returns a |
| 63 | +/// `CollectedResult` containing the output of the child process. |
64 | 64 | /// - Parameters: |
65 | 65 | /// - executable: The executable to run. |
66 | 66 | /// - arguments: The arguments to pass to the executable. |
67 | 67 | /// - environment: The environment in which to run the executable. |
68 | 68 | /// - workingDirectory: The working directory in which to run the executable. |
69 | | -/// - platformOptions: The platform specific options to use |
70 | | -/// when running the executable. |
| 69 | +/// - platformOptions: The platform-specific options to use when running the executable. |
71 | 70 | /// - input: span to write to subprocess' standard input. |
72 | 71 | /// - output: The method to use for redirecting the standard output. |
73 | 72 | /// - error: The method to use for redirecting the standard error. |
74 | | -/// - Returns a CollectedResult containing the result of the run. |
75 | | -#if SubprocessSpan |
| 73 | +/// - Returns: a CollectedResult containing the result of the run. |
76 | 74 | public func run< |
77 | 75 | InputElement: BitwiseCopyable, |
78 | 76 | Output: OutputProtocol, |
@@ -138,21 +136,19 @@ public func run< |
138 | 136 | // MARK: - Custom Execution Body |
139 | 137 |
|
140 | 138 | /// Run an executable with given parameters and a custom closure |
141 | | -/// to manage the running subprocess' lifetime and stream its standard output. |
| 139 | +/// to manage the running subprocess’ lifetime. |
142 | 140 | /// - Parameters: |
143 | 141 | /// - executable: The executable to run. |
144 | 142 | /// - arguments: The arguments to pass to the executable. |
145 | 143 | /// - environment: The environment in which to run the executable. |
146 | 144 | /// - workingDirectory: The working directory in which to run the executable. |
147 | | -/// - platformOptions: The platform specific options to use |
148 | | -/// when running the executable. |
| 145 | +/// - platformOptions: The platform-specific options to use when running the executable. |
149 | 146 | /// - input: The input to send to the executable. |
150 | | -/// - output: How to manager executable standard output. |
151 | | -/// - error: How to manager executable standard error. |
| 147 | +/// - output: How to manage executable standard output. |
| 148 | +/// - error: How to manage executable standard error. |
152 | 149 | /// - isolation: the isolation context to run the body closure. |
153 | 150 | /// - body: The custom execution body to manually control the running process |
154 | | -/// - Returns an executableResult type containing the return value |
155 | | -/// of the closure. |
| 151 | +/// - Returns: an `ExecutableResult` type containing the return value of the closure. |
156 | 152 | public func run<Result, Input: InputProtocol, Output: OutputProtocol, Error: OutputProtocol>( |
157 | 153 | _ executable: Executable, |
158 | 154 | arguments: Arguments = [], |
@@ -198,21 +194,19 @@ public func run<Result, Input: InputProtocol, Output: OutputProtocol, Error: Out |
198 | 194 | } |
199 | 195 | } |
200 | 196 |
|
201 | | -/// Run an executable with given parameters and a custom closure |
202 | | -/// to manage the running subprocess' lifetime and stream its standard output. |
| 197 | +/// Run an executable with given parameters and a custom closure to manage the |
| 198 | +/// running subprocess' lifetime and stream its standard output. |
203 | 199 | /// - Parameters: |
204 | 200 | /// - executable: The executable to run. |
205 | 201 | /// - arguments: The arguments to pass to the executable. |
206 | 202 | /// - environment: The environment in which to run the executable. |
207 | 203 | /// - workingDirectory: The working directory in which to run the executable. |
208 | | -/// - platformOptions: The platform specific options to use |
209 | | -/// when running the executable. |
| 204 | +/// - platformOptions: The platform-specific options to use when running the executable. |
210 | 205 | /// - input: The input to send to the executable. |
211 | | -/// - error: How to manager executable standard error. |
| 206 | +/// - error: How to manage executable standard error. |
212 | 207 | /// - isolation: the isolation context to run the body closure. |
213 | | -/// - body: The custom execution body to manually control the running process |
214 | | -/// - Returns an executableResult type containing the return value |
215 | | -/// of the closure. |
| 208 | +/// - body: The custom execution body to manually control the running process. |
| 209 | +/// - Returns: an `ExecutableResult` type containing the return value of the closure. |
216 | 210 | public func run<Result, Input: InputProtocol, Error: OutputProtocol>( |
217 | 211 | _ executable: Executable, |
218 | 212 | arguments: Arguments = [], |
@@ -260,21 +254,19 @@ public func run<Result, Input: InputProtocol, Error: OutputProtocol>( |
260 | 254 | } |
261 | 255 | } |
262 | 256 |
|
263 | | -/// Run an executable with given parameters and a custom closure |
264 | | -/// to manage the running subprocess' lifetime and stream its standard error. |
| 257 | +/// Run an executable with given parameters and a custom closure to manage the |
| 258 | +/// running subprocess' lifetime and stream its standard error. |
265 | 259 | /// - Parameters: |
266 | 260 | /// - executable: The executable to run. |
267 | 261 | /// - arguments: The arguments to pass to the executable. |
268 | 262 | /// - environment: The environment in which to run the executable. |
269 | 263 | /// - workingDirectory: The working directory in which to run the executable. |
270 | | -/// - platformOptions: The platform specific options to use |
271 | | -/// when running the executable. |
| 264 | +/// - platformOptions: The platform-specific options to use when running the executable. |
272 | 265 | /// - input: The input to send to the executable. |
273 | | -/// - output: How to manager executable standard output. |
274 | | -/// - isolation: the isolation context to run the body closure. |
| 266 | +/// - output: How to manage executable standard output. |
| 267 | +/// - isolation: The isolation context to run the body closure. |
275 | 268 | /// - body: The custom execution body to manually control the running process |
276 | | -/// - Returns an executableResult type containing the return value |
277 | | -/// of the closure. |
| 269 | +/// - Returns: an `ExecutableResult` type containing the return value of the closure. |
278 | 270 | public func run<Result, Input: InputProtocol, Output: OutputProtocol>( |
279 | 271 | _ executable: Executable, |
280 | 272 | arguments: Arguments = [], |
@@ -322,21 +314,18 @@ public func run<Result, Input: InputProtocol, Output: OutputProtocol>( |
322 | 314 | } |
323 | 315 | } |
324 | 316 |
|
325 | | -/// Run an executable with given parameters and a custom closure |
326 | | -/// to manage the running subprocess' lifetime, write to its |
327 | | -/// standard input, and stream its standard output. |
| 317 | +/// Run an executable with given parameters and a custom closure to manage the |
| 318 | +/// running subprocess' lifetime, write to its standard input, and stream its standard output. |
328 | 319 | /// - Parameters: |
329 | 320 | /// - executable: The executable to run. |
330 | 321 | /// - arguments: The arguments to pass to the executable. |
331 | 322 | /// - environment: The environment in which to run the executable. |
332 | 323 | /// - workingDirectory: The working directory in which to run the executable. |
333 | | -/// - platformOptions: The platform specific options to use |
334 | | -/// when running the executable. |
335 | | -/// - error: How to manager executable standard error. |
| 324 | +/// - platformOptions: The platform-specific options to use when running the executable. |
| 325 | +/// - error: How to manage executable standard error. |
336 | 326 | /// - isolation: the isolation context to run the body closure. |
337 | 327 | /// - body: The custom execution body to manually control the running process |
338 | | -/// - Returns an executableResult type containing the return value |
339 | | -/// of the closure. |
| 328 | +/// - Returns: An `ExecutableResult` type containing the return value of the closure. |
340 | 329 | public func run<Result, Error: OutputProtocol>( |
341 | 330 | _ executable: Executable, |
342 | 331 | arguments: Arguments = [], |
@@ -367,21 +356,18 @@ public func run<Result, Error: OutputProtocol>( |
367 | 356 | } |
368 | 357 | } |
369 | 358 |
|
370 | | -/// Run an executable with given parameters and a custom closure |
371 | | -/// to manage the running subprocess' lifetime, write to its |
372 | | -/// standard input, and stream its standard error. |
| 359 | +/// Run an executable with given parameters and a custom closure to manage the |
| 360 | +/// running subprocess' lifetime, write to its standard input, and stream its standard error. |
373 | 361 | /// - Parameters: |
374 | 362 | /// - executable: The executable to run. |
375 | 363 | /// - arguments: The arguments to pass to the executable. |
376 | 364 | /// - environment: The environment in which to run the executable. |
377 | 365 | /// - workingDirectory: The working directory in which to run the executable. |
378 | | -/// - platformOptions: The platform specific options to use |
379 | | -/// when running the executable. |
380 | | -/// - output: How to manager executable standard output. |
| 366 | +/// - platformOptions: The platform-specific options to use when running the executable. |
| 367 | +/// - output: How to manage executable standard output. |
381 | 368 | /// - isolation: the isolation context to run the body closure. |
382 | 369 | /// - body: The custom execution body to manually control the running process |
383 | | -/// - Returns an executableResult type containing the return value |
384 | | -/// of the closure. |
| 370 | +/// - Returns: An `ExecutableResult` type containing the return value of the closure. |
385 | 371 | public func run<Result, Output: OutputProtocol>( |
386 | 372 | _ executable: Executable, |
387 | 373 | arguments: Arguments = [], |
@@ -413,19 +399,17 @@ public func run<Result, Output: OutputProtocol>( |
413 | 399 | } |
414 | 400 |
|
415 | 401 | /// Run an executable with given parameters and a custom closure |
416 | | -/// to manage the running subprocess' lifetime, write to its |
| 402 | +/// to manage the running subprocess’ lifetime, write to its |
417 | 403 | /// standard input, and stream its standard output and standard error. |
418 | 404 | /// - Parameters: |
419 | 405 | /// - executable: The executable to run. |
420 | 406 | /// - arguments: The arguments to pass to the executable. |
421 | 407 | /// - environment: The environment in which to run the executable. |
422 | 408 | /// - workingDirectory: The working directory in which to run the executable. |
423 | | -/// - platformOptions: The platform specific options to use |
424 | | -/// when running the executable. |
| 409 | +/// - platformOptions: The platform-specific options to use when running the executable. |
425 | 410 | /// - isolation: the isolation context to run the body closure. |
426 | 411 | /// - body: The custom execution body to manually control the running process |
427 | | -/// - Returns an executableResult type containing the return value |
428 | | -/// of the closure. |
| 412 | +/// - Returns: an `ExecutableResult` type containing the return value of the closure. |
429 | 413 | public func run<Result>( |
430 | 414 | _ executable: Executable, |
431 | 415 | arguments: Arguments = [], |
@@ -474,7 +458,7 @@ public func run<Result>( |
474 | 458 | /// - input: The input to send to the executable. |
475 | 459 | /// - output: The method to use for redirecting the standard output. |
476 | 460 | /// - error: The method to use for redirecting the standard error. |
477 | | -/// - Returns a CollectedResult containing the result of the run. |
| 461 | +/// - Returns: a `CollectedResult` containing the result of the run. |
478 | 462 | public func run< |
479 | 463 | Input: InputProtocol, |
480 | 464 | Output: OutputProtocol, |
@@ -562,9 +546,8 @@ public func run< |
562 | 546 | /// - isolation: the isolation context to run the body closure. |
563 | 547 | /// - body: The custom configuration body to manually control |
564 | 548 | /// the running process, write to its standard input, stream |
565 | | -/// its standard output and standard error. |
566 | | -/// - Returns an executableResult type containing the return value |
567 | | -/// of the closure. |
| 549 | +/// the standard output and standard error. |
| 550 | +/// - Returns: an `ExecutableResult` type containing the return value of the closure. |
568 | 551 | public func run<Result>( |
569 | 552 | _ configuration: Configuration, |
570 | 553 | isolation: isolated (any Actor)? = #isolation, |
|
0 commit comments