Skip to content

Commit 777930b

Browse files
authored
Remove platform requirement from Package.swift (#427)
Adding the platform requirement is a source breaking change; this moves the requirement down to the `async` symbols instead.
1 parent 7dd164a commit 777930b

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Examples/count-lines/CountLines.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import ArgumentParser
1313
import Foundation
1414

1515
@main
16+
@available(macOS 10.15, *)
1617
struct CountLines: AsyncParsableCommand {
1718
@Argument(
1819
help: "A file to count lines in. If omitted, counts the lines of stdin.",
@@ -26,6 +27,7 @@ struct CountLines: AsyncParsableCommand {
2627
var verbose = false
2728
}
2829

30+
@available(macOS 10.15, *)
2931
extension CountLines {
3032
var fileHandle: FileHandle {
3133
get throws {

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import PackageDescription
1414

1515
var package = Package(
1616
name: "swift-argument-parser",
17-
platforms: [.macOS(.v10_15), .macCatalyst(.v13), .iOS(.v13), .tvOS(.v13), .watchOS(.v6)],
1817
products: [
1918
.library(
2019
name: "ArgumentParser",

Sources/ArgumentParser/Parsable Types/AsyncParsableCommand.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
/// A type that can be executed asynchronously, as part of a nested tree of
1313
/// commands.
14+
@available(macOS 10.15, macCatalyst 13, iOS 13, tvOS 13, watchOS 6, *)
1415
public protocol AsyncParsableCommand: ParsableCommand {
1516
/// The behavior or functionality of this command.
1617
///
@@ -22,6 +23,7 @@ public protocol AsyncParsableCommand: ParsableCommand {
2223
mutating func run() async throws
2324
}
2425

26+
@available(macOS 10.15, macCatalyst 13, iOS 13, tvOS 13, watchOS 6, *)
2527
extension AsyncParsableCommand {
2628
/// Executes this command, or one of its subcommands, with the program's
2729
/// command-line arguments.
@@ -54,6 +56,7 @@ public protocol AsyncMainProtocol {
5456
}
5557

5658
@available(swift, deprecated: 5.6)
59+
@available(macOS 10.15, macCatalyst 13, iOS 13, tvOS 13, watchOS 6, *)
5760
extension AsyncMainProtocol {
5861
/// Executes the designated command type, or one of its subcommands, with
5962
/// the program's command-line arguments.

0 commit comments

Comments
 (0)