-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathDownloadFirmwareOptions.swift
More file actions
116 lines (98 loc) · 4.21 KB
/
DownloadFirmwareOptions.swift
File metadata and controls
116 lines (98 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
//
// DownloadFirmwareOptions.swift
// Mist
//
// Created by Nindi Gill on 30/5/2022.
//
import ArgumentParser
struct DownloadFirmwareOptions: ParsableArguments {
@Argument(help: """
Specify a macOS name, version or build to download:
Name │ Version │ Build
───────────────┼─────────┼──────
macOS Tahoe | 26.x │ 25xyz
macOS Sequoia | 15.x │ 24xyz
macOS Sonoma │ 14.x │ 23xyz
macOS Ventura │ 13.x │ 22xyz
macOS Monterey │ 12.x │ 21xyz
macOS Big Sur │ 11.x │ 20xyz
Note: Specifying a macOS name will assume the latest version and build of that particular macOS.
Note: Specifying a macOS version will look for an exact match, otherwise assume the latest build of that particular macOS.
""")
var searchString: String
@Flag(name: [.customShort("b"), .long], help: """
Include beta macOS Firmwares in search results.
""")
var includeBetas: Bool = false
@Flag(name: .long, help: """
Only include macOS Firmwares that are compatible with this Mac in search results.
""")
var compatible: Bool = false
@Flag(name: .long, help: """
Cache downloaded files in the temporary downloads directory.
""")
var cacheDownloads: Bool = false
@Flag(name: .shortAndLong, help: """
Force overwriting existing macOS Downloads matching the provided filename(s).
Note: Downloads will fail if an existing file is found and this flag is not provided.
""")
var force: Bool = false
@Option(name: .long, help: """
Specify the macOS Firmware output filename. The following variables will be dynamically substituted:
* %NAME% will be replaced with 'macOS Sonoma'
* %VERSION% will be replaced with '14.0'
* %BUILD% will be replaced with '23A344'
""")
var firmwareName: String = .filenameTemplate + ".ipsw"
@Option(name: .shortAndLong, help: """
Specify the output directory. The following variables will be dynamically substituted:
* %NAME% will be replaced with 'macOS Sonoma'
* %VERSION% will be replaced with '14.0'
* %BUILD% will be replaced with '23A344'
Note: Parent directories will be created automatically.
""")
var outputDirectory: String = .outputDirectory
@Option(name: .shortAndLong, help: """
Specify the temporary downloads directory.
Note: Parent directories will be created automatically.
""")
var temporaryDirectory: String = .temporaryDirectory
@Option(name: .long, help: """
Optionally specify the <url:port> to an Apple Content Caching Server to help speed up downloads
Note: Content Caching is only supported over HTTP, not HTTPS
""")
var cachingServer: String?
@Option(name: [.customShort("e"), .customLong("export")], help: """
Specify the path to export the download results to one of the following formats:
* /path/to/export.json (JSON file)
* /path/to/export.plist (Property List file)
* /path/to/export.yaml (YAML file)
The following variables will be dynamically substituted:
* %NAME% will be replaced with 'macOS Sonoma'
* %VERSION% will be replaced with '14.0'
* %BUILD% will be replaced with '23A344'
Note: The file extension will determine the output file format.
Note: Parent directories will be created automatically.
""")
var exportPath: String?
@Option(name: .customLong("metadata-cache"), help: """
Optionally specify the path to cache the macOS Firmwares metadata JSON file. This cache is used when mist is unable to retrieve macOS Firmwares remotely.
""")
var metadataCachePath: String = .firmwaresMetadataCachePath
@Flag(name: .long, help: """
Remove all ANSI escape sequences (ie. strip all color and formatting) from standard output.
""")
var noAnsi: Bool = false
@Option(name: .long, help: """
Number of times to attempt resuming a download before failing.
""")
var retries: Int = 10
@Option(name: .long, help: """
Number of seconds to wait before attempting to resume a download.
""")
var retryDelay: Int = 30
@Flag(name: .shortAndLong, help: """
Suppress verbose output.
""")
var quiet: Bool = false
}