@@ -41,14 +41,15 @@ public struct Configuration: Sendable {
41
41
/// The environment to use when running the executable.
42
42
public var environment : Environment
43
43
/// The working directory to use when running the executable.
44
+ ///
44
45
/// If this property is `nil`, the subprocess will inherit
45
46
/// the working directory from the parent process.
46
47
public var workingDirectory : FilePath ?
47
48
/// The platform specific options to use when
48
49
/// running the subprocess.
49
50
public var platformOptions : PlatformOptions
50
51
51
- /// Creates a Configuration with the given parameters
52
+ /// Creates a Configuration with the parameters you provide.
52
53
/// - Parameters:
53
54
/// - executable: the executable to run
54
55
/// - arguments: the arguments to pass to the executable.
@@ -127,7 +128,7 @@ public struct Configuration: Sendable {
127
128
}
128
129
129
130
extension Configuration : CustomStringConvertible , CustomDebugStringConvertible {
130
- /// A textual representation of this `Configuration` .
131
+ /// A textual representation of this configuration .
131
132
public var description : String {
132
133
return """
133
134
Configuration(
@@ -140,7 +141,7 @@ extension Configuration: CustomStringConvertible, CustomDebugStringConvertible {
140
141
"""
141
142
}
142
143
143
- /// A textual representation of this `Configuration` .
144
+ /// A debug-oriented textual representation of this configuration .
144
145
public var debugDescription : String {
145
146
return """
146
147
Configuration(
@@ -208,8 +209,7 @@ extension Configuration {
208
209
209
210
// MARK: - Executable
210
211
211
- /// Executable defines how the executable should be
212
- /// looked up for execution.
212
+ /// Executable defines how subprocess looks up the executable for execution.
213
213
public struct Executable : Sendable , Hashable {
214
214
internal enum Storage : Sendable , Hashable {
215
215
case executable( String )
@@ -241,7 +241,7 @@ public struct Executable: Sendable, Hashable {
241
241
}
242
242
243
243
extension Executable : CustomStringConvertible , CustomDebugStringConvertible {
244
- /// A textual representation of this `Executable` .
244
+ /// A textual representation of this executable .
245
245
public var description : String {
246
246
switch storage {
247
247
case . executable( let executableName) :
@@ -251,7 +251,7 @@ extension Executable: CustomStringConvertible, CustomDebugStringConvertible {
251
251
}
252
252
}
253
253
254
- /// A textual representation of this `Executable` .
254
+ /// A debug-oriented textual representation of this executable .
255
255
public var debugDescription : String {
256
256
switch storage {
257
257
case . executable( let string) :
@@ -316,7 +316,7 @@ public struct Arguments: Sendable, ExpressibleByArrayLiteral, Hashable {
316
316
self . executablePathOverride = nil
317
317
}
318
318
}
319
- /// Create an Arguments object using the given array
319
+ /// Create an arguments object using the array you provide.
320
320
public init ( _ array: [ [ UInt8 ] ] ) {
321
321
self . storage = array. map { . rawBytes( $0) }
322
322
self . executablePathOverride = nil
@@ -325,7 +325,7 @@ public struct Arguments: Sendable, ExpressibleByArrayLiteral, Hashable {
325
325
}
326
326
327
327
extension Arguments : CustomStringConvertible , CustomDebugStringConvertible {
328
- /// A textual representation of this `Arguments` .
328
+ /// A textual representation of the arguments .
329
329
public var description : String {
330
330
var result : [ String ] = self . storage. map ( \. description)
331
331
@@ -335,7 +335,7 @@ extension Arguments: CustomStringConvertible, CustomDebugStringConvertible {
335
335
return result. description
336
336
}
337
337
338
- /// A textual representation of this `Arguments` .
338
+ /// A debug-oriented textual representation of the arguments .
339
339
public var debugDescription : String { return self . description }
340
340
}
341
341
@@ -379,7 +379,7 @@ public struct Environment: Sendable, Hashable {
379
379
}
380
380
381
381
extension Environment : CustomStringConvertible , CustomDebugStringConvertible {
382
- /// A textual representation of this `Environment` .
382
+ /// A textual representation of the environment .
383
383
public var description : String {
384
384
switch self . config {
385
385
case . custom( let customDictionary) :
@@ -402,7 +402,7 @@ extension Environment: CustomStringConvertible, CustomDebugStringConvertible {
402
402
}
403
403
}
404
404
405
- /// A textual representation of this `Environment` .
405
+ /// A debug-oriented textual representation of the environment .
406
406
public var debugDescription : String {
407
407
return self . description
408
408
}
@@ -440,14 +440,14 @@ extension Environment: CustomStringConvertible, CustomDebugStringConvertible {
440
440
441
441
// MARK: - TerminationStatus
442
442
443
- /// An exit status of a subprocess
443
+ /// An exit status of a subprocess.
444
444
@frozen
445
445
public enum TerminationStatus : Sendable , Hashable {
446
446
#if canImport(WinSDK)
447
- /// The type of status code
447
+ /// The type of the status code.
448
448
public typealias Code = DWORD
449
449
#else
450
- /// The type of status code
450
+ /// The type of the status code.
451
451
public typealias Code = CInt
452
452
#endif
453
453
@@ -467,7 +467,7 @@ public enum TerminationStatus: Sendable, Hashable {
467
467
}
468
468
469
469
extension TerminationStatus : CustomStringConvertible , CustomDebugStringConvertible {
470
- /// A textual representation of this `TerminationStatus` .
470
+ /// A textual representation of this termination status .
471
471
public var description : String {
472
472
switch self {
473
473
case . exited( let code) :
@@ -477,7 +477,7 @@ extension TerminationStatus: CustomStringConvertible, CustomDebugStringConvertib
477
477
}
478
478
}
479
479
480
- /// A textual representation of this `TerminationStatus` .
480
+ /// A debug-oriented textual representation of this termination status .
481
481
public var debugDescription : String {
482
482
return self . description
483
483
}
@@ -651,9 +651,11 @@ internal func _safelyClose(_ target: _CloseTarget) throws {
651
651
}
652
652
}
653
653
654
- /// IODescriptor wraps platform-specific FileDescriptor , which is used to establish a
654
+ /// An IO descriptor wraps platform-specific file descriptor , which establishes a
655
655
/// connection to the standard input/output (IO) system during the process of
656
- /// spawning a child process. Unlike IODescriptor, the IODescriptor does not support
656
+ /// spawning a child process.
657
+ ///
658
+ /// Unlike a file descriptor, the `IODescriptor` does not support
657
659
/// data read/write operations; its primary function is to facilitate the spawning of
658
660
/// child processes by providing a platform-specific file descriptor.
659
661
internal struct IODescriptor : ~ Copyable {
@@ -965,10 +967,12 @@ extension Optional where Wrapped == String {
965
967
}
966
968
}
967
969
968
- /// Runs `body`, and then runs `onCleanup` if `body` throws an error,
969
- /// or if the parent task is cancelled. In the latter case, `onCleanup`
970
- /// may be run concurrently with `body`. `body` is guaranteed to run exactly once.
971
- /// `onCleanup` is guaranteed to run only once, or not at all.
970
+ /// Runs the body close, then runs the on-cleanup closure if the body closure throws an error
971
+ /// or if the parent task is cancelled.
972
+ ///
973
+ /// In the latter case, `onCleanup` may be run concurrently with `body`.
974
+ /// The `body` closure is guaranteed to run exactly once.
975
+ /// The `onCleanup` closure is guaranteed to run only once, or not at all.
972
976
internal func withAsyncTaskCleanupHandler< Result> (
973
977
_ body: ( ) async throws -> Result ,
974
978
onCleanup handler: @Sendable @escaping ( ) async -> Void ,
0 commit comments