Skip to content

Commit d875869

Browse files
authored
Merge branch 'main' into dev
2 parents 7659317 + 852f74c commit d875869

File tree

8 files changed

+46
-4
lines changed

8 files changed

+46
-4
lines changed

CHANGELOG.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Add new items at the end of the relevant section under **Unreleased**.
66

77
## [Unreleased]
88

9+
---
10+
11+
## [1.6.0] - 2025-06-30
12+
913
### Additions
1014

1115
- Options with `CaseIterable` types can now provide help descriptions on a per-value basis. ([#647])
@@ -16,6 +20,8 @@ Add new items at the end of the relevant section under **Unreleased**.
1620

1721
- Testing and continuous integration improvements, including migrating to GitHub workflows.
1822
([#692], [#693], [#696], [#698], [#699], [#700], [#701], [#708], [#711], [#718], [#716], [#714], [#712], [#732], [#730], [#746], [#747], [#760])
23+
- The associated closure for `CompletionKind.custom` now takes three parameters: the array of shell words currently in use for the completion request, the offset in that array for the word that completions are being requested for, and the prefix of that word that precedes the cursor. In addition, the associated closure can be `async`. The single-argument closure version of `CompletionKind.custom` is deprecated with this release. ([#763], [#770], [#782])
24+
- `ParsableArguments` and `ExpressibleByArgument` now conform to `SendableMetatype` when builing with a minimum Swift 6.2 compiler. ([#789])
1925

2026
### Fixes
2127

@@ -30,6 +36,10 @@ Add new items at the end of the relevant section under **Unreleased**.
3036
- Better capturing of tool configuration in `ToolInfo`. ([#669], [#697])
3137
- Documentation improvements. ([#657], [#678], [#743])
3238

39+
The 1.6.0 release includes contributions from [bripeticca], [cg-soft], [compnerd],
40+
[dshan4585], [heckj], [natecook1000], [rauhul], [rgoldberg], and [Steelskin].
41+
Thank you!
42+
3343
---
3444

3545
## [1.5.1] - 2025-05-28
@@ -943,7 +953,8 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
943953

944954
<!-- Link references for releases -->
945955

946-
[Unreleased]: https://github.com/apple/swift-argument-parser/compare/1.5.1...HEAD
956+
[Unreleased]: https://github.com/apple/swift-argument-parser/compare/1.6.0...HEAD
957+
[1.6.0]: https://github.com/apple/swift-argument-parser/compare/1.5.1...1.6.0
947958
[1.5.1]: https://github.com/apple/swift-argument-parser/compare/1.5.0...1.5.1
948959
[1.5.0]: https://github.com/apple/swift-argument-parser/compare/1.4.0...1.5.0
949960
[1.4.0]: https://github.com/apple/swift-argument-parser/compare/1.3.1...1.4.0
@@ -1130,7 +1141,9 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
11301141
[#773]: https://github.com/apple/swift-argument-parser/pull/773
11311142
[#775]: https://github.com/apple/swift-argument-parser/pull/775
11321143
[#777]: https://github.com/apple/swift-argument-parser/pull/777
1144+
[#782]: https://github.com/apple/swift-argument-parser/pull/782
11331145
[#783]: https://github.com/apple/swift-argument-parser/pull/783
1146+
[#789]: https://github.com/apple/swift-argument-parser/pull/789
11341147

11351148
<!-- Link references for contributors -->
11361149

@@ -1144,7 +1157,9 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
11441157
[atierian]: https://github.com/apple/swift-argument-parser/commits?author=atierian
11451158
[Austinpayne]: https://github.com/apple/swift-argument-parser/commits?author=Austinpayne
11461159
[BradLarson]: https://github.com/apple/swift-argument-parser/commits?author=BradLarson
1160+
[bripeticca]: https://github.com/apple/swift-argument-parser/commits?author=bripeticca
11471161
[buttaface]: https://github.com/apple/swift-argument-parser/commits?author=buttaface
1162+
[cg-soft]: https://github.com/apple/swift-argument-parser/commits?author=cg-soft
11481163
[Chamepp]: https://github.com/apple/swift-argument-parser/commits?author=Chamepp
11491164
[clayellis]: https://github.com/apple/swift-argument-parser/commits?author=clayellis
11501165
[CodaFi]: https://github.com/apple/swift-argument-parser/commits?author=CodaFi
@@ -1159,6 +1174,7 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
11591174
[dirtyhabits97]: https://github.com/apple/swift-argument-parser/commits?author=dirtyhabits97
11601175
[DougGregor]: https://github.com/apple/swift-argument-parser/commits?author=DougGregor
11611176
[drewmccormack]: https://github.com/apple/swift-argument-parser/commits?author=drewmccormack
1177+
[dshan4585]: https://github.com/apple/swift-argument-parser/commits?author=dshan4585
11621178
[elliottwilliams]: https://github.com/apple/swift-argument-parser/commits?author=elliottwilliams
11631179
[erica]: https://github.com/apple/swift-argument-parser/commits?author=erica
11641180
[finagolfin]: https://github.com/apple/swift-argument-parser/commits?author=finagolfin
@@ -1169,6 +1185,7 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
11691185
[gmittert]: https://github.com/apple/swift-argument-parser/commits?author=gmittert
11701186
[griffin-stewie]: https://github.com/apple/swift-argument-parser/commits?author=griffin-stewie
11711187
[gwynne]: https://github.com/apple/swift-argument-parser/commits?author=gwynne
1188+
[heckj]: https://github.com/apple/swift-argument-parser/commits?author=heckj
11721189
[iainsmith]: https://github.com/apple/swift-argument-parser/commits?author=iainsmith
11731190
[ian-twilightcoder]: https://github.com/apple/swift-argument-parser/commits?author=ian-twilightcoder
11741191
[ibrahimoktay]: https://github.com/apple/swift-argument-parser/commits?author=ibrahimoktay
@@ -1206,6 +1223,7 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
12061223
[randomeizer]: https://github.com/apple/swift-argument-parser/commits?author=randomeizer
12071224
[rauhul]: https://github.com/apple/swift-argument-parser/commits?author=rauhul
12081225
[revolter]: https://github.com/apple/swift-argument-parser/commits?author=revolter
1226+
[rgoldberg]: https://github.com/apple/swift-argument-parser/commits?author=rgoldberg
12091227
[rickrizzo]: https://github.com/apple/swift-argument-parser/commits?author=rickrizzo
12101228
[rjstelling]: https://github.com/apple/swift-argument-parser/commits?author=rjstelling
12111229
[robertmryan]: https://github.com/apple/swift-argument-parser/commits?author=robertmryan
@@ -1215,6 +1233,7 @@ This changelog's format is based on [Keep a Changelog](https://keepachangelog.co
12151233
[sgl0v]: https://github.com/apple/swift-argument-parser/commits?author=sgl0v
12161234
[sharplet]: https://github.com/apple/swift-argument-parser/commits?author=sharplet
12171235
[sjavora]: https://github.com/apple/swift-argument-parser/commits?author=sjavora
1236+
[Steelskin]: https://github.com/apple/swift-argument-parser/commits?author=Steelskin
12181237
[stuartcarnie]: https://github.com/apple/swift-argument-parser/commits?author=stuartcarnie
12191238
[thomasvl]: https://github.com/apple/swift-argument-parser/commits?author=thomasvl
12201239
[TiagoMaiaL]: https://github.com/apple/swift-argument-parser/commits?author=TiagoMaiaL

Sources/ArgumentParser/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ add_library(ArgumentParser
4646
Utilities/Platform.swift
4747
Utilities/SequenceExtensions.swift
4848
Utilities/StringExtensions.swift
49+
Utilities/SwiftExtensions.swift
4950
Utilities/Tree.swift
5051

5152
Validators/CodingKeyValidator.swift

Sources/ArgumentParser/Parsable Types/ExpressibleByArgument.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//===----------------------------------------------------------------------===//
1111

1212
/// A type that can be expressed as a command-line argument.
13-
public protocol ExpressibleByArgument {
13+
public protocol ExpressibleByArgument: _SendableMetatype {
1414
/// Creates a new instance of this type from a command-line-specified
1515
/// argument.
1616
init?(argument: String)

Sources/ArgumentParser/Parsable Types/ParsableArguments.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
///
1414
/// When you implement a `ParsableArguments` type, all properties must be declared with
1515
/// one of the four property wrappers provided by the `ArgumentParser` library.
16-
public protocol ParsableArguments: Decodable {
16+
public protocol ParsableArguments: Decodable, _SendableMetatype {
1717
/// Creates an instance of this parsable type using the definitions
1818
/// given by each property's wrapper.
1919
init()
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the Swift Argument Parser open source project
4+
//
5+
// Copyright (c) 2020 Apple Inc. and the Swift project authors
6+
// Licensed under Apache License v2.0 with Runtime Library Exception
7+
//
8+
// See https://swift.org/LICENSE.txt for license information
9+
//
10+
//===----------------------------------------------------------------------===//
11+
12+
#if compiler(>=6.2)
13+
/// Designates a type as having a sendable metatype.
14+
public protocol _SendableMetatype: SendableMetatype {}
15+
#else
16+
public protocol _SendableMetatype {}
17+
#endif

Tests/ArgumentParserEndToEndTests/CustomParsingEndToEndTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,19 @@ extension Array where Element == Name {
3535
// MARK: -
3636

3737
private struct Foo: ParsableCommand {
38-
enum Subgroup: Equatable {
38+
enum Subgroup: Equatable, Sendable {
3939
case first(Int)
4040
case second(Int)
4141

42+
@Sendable
4243
static func makeFirst(_ str: String) throws -> Subgroup {
4344
guard let value = Int(str) else {
4445
throw ValidationError("Not a valid integer for 'first'")
4546
}
4647
return .first(value)
4748
}
4849

50+
@Sendable
4951
static func makeSecond(_ str: String) throws -> Subgroup {
5052
guard let value = Int(str) else {
5153
throw ValidationError("Not a valid integer for 'second'")

Tests/ArgumentParserUnitTests/HelpGenerationTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ extension HelpGenerationTests {
148148
enum OptionFlags: String, EnumerableFlag { case optional, required }
149149
enum Degree {
150150
case bachelor, graduate, doctorate
151+
152+
@Sendable
151153
static func degreeTransform(_ string: String) throws -> Degree {
152154
switch string {
153155
case "bachelor":

Tests/ArgumentParserUnitTests/UsageGenerationTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ extension UsageGenerationTests {
132132
enum Color {
133133
case red, blue
134134

135+
@Sendable
135136
static func transform(_ string: String) throws -> Color {
136137
switch string {
137138
case "red":

0 commit comments

Comments
 (0)