Skip to content

Commit

Permalink
Fix compile failure on iOS for Mac Catalyst support (#356)
Browse files Browse the repository at this point in the history
* Fix compile failure on iOS

* Add sortedKeys API check for tvOS and watchOS
  • Loading branch information
imxieyi authored Sep 13, 2021
1 parent fd4c3b6 commit afe0b95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/ArgumentParser/Usage/DumpHelpGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ internal struct DumpHelpGenerator {
func rendered() -> String {
let encoder = JSONEncoder()
encoder.outputFormatting = .prettyPrinted
if #available(macOS 10.13, *) {
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
encoder.outputFormatting.insert(.sortedKeys)
}
guard let encoded = try? encoder.encode(self.toolInfo) else { return "" }
Expand Down

0 comments on commit afe0b95

Please sign in to comment.