diff --git a/Sources/ArgumentParser/Usage/DumpHelpGenerator.swift b/Sources/ArgumentParser/Usage/DumpHelpGenerator.swift index 0449c1806..7db5d305e 100644 --- a/Sources/ArgumentParser/Usage/DumpHelpGenerator.swift +++ b/Sources/ArgumentParser/Usage/DumpHelpGenerator.swift @@ -9,11 +9,19 @@ // //===----------------------------------------------------------------------===// +#if swift(>=5.11) +internal import ArgumentParserToolInfo +internal import class Foundation.JSONEncoder +#elseif swift(>=5.10) +import ArgumentParserToolInfo +import class Foundation.JSONEncoder +#else @_implementationOnly import ArgumentParserToolInfo @_implementationOnly import class Foundation.JSONEncoder +#endif internal struct DumpHelpGenerator { - var toolInfo: ToolInfoV0 + private var toolInfo: ToolInfoV0 init(_ type: ParsableArguments.Type) { self.init(commandStack: [type.asCommand]) diff --git a/Sources/ArgumentParser/Usage/MessageInfo.swift b/Sources/ArgumentParser/Usage/MessageInfo.swift index cb1da6f4d..bb9a4ea1d 100644 --- a/Sources/ArgumentParser/Usage/MessageInfo.swift +++ b/Sources/ArgumentParser/Usage/MessageInfo.swift @@ -9,8 +9,16 @@ // //===----------------------------------------------------------------------===// +#if swift(>=5.11) +internal import protocol Foundation.LocalizedError +internal import class Foundation.NSError +#elseif swift(>=5.10) +import protocol Foundation.LocalizedError +import class Foundation.NSError +#else @_implementationOnly import protocol Foundation.LocalizedError @_implementationOnly import class Foundation.NSError +#endif enum MessageInfo { case help(text: String) diff --git a/Sources/ArgumentParser/Usage/UsageGenerator.swift b/Sources/ArgumentParser/Usage/UsageGenerator.swift index c6270ae42..e34b94ee6 100644 --- a/Sources/ArgumentParser/Usage/UsageGenerator.swift +++ b/Sources/ArgumentParser/Usage/UsageGenerator.swift @@ -9,7 +9,13 @@ // //===----------------------------------------------------------------------===// +#if swift(>=5.11) +internal import protocol Foundation.LocalizedError +#elseif swift(>=5.10) +import protocol Foundation.LocalizedError +#else @_implementationOnly import protocol Foundation.LocalizedError +#endif struct UsageGenerator { var toolName: String