@@ -25,12 +25,14 @@ func usage(print: (String) -> Void = { print($0) }) {
25
25
print ( " dist - All of 'build' plus downloaded packages " )
26
26
print ( " If no mode is given, 'build' is the default. " )
27
27
print ( " --init Creates a new Swift project " )
28
+ print ( " --fetch Fetch package dependencies " )
28
29
print ( " " )
29
30
print ( " OPTIONS: " )
30
31
print ( " --chdir <value> Change working directory before any other operation [-C] " )
31
32
print ( " -v[v] Increase verbosity of informational output " )
32
33
print ( " -Xcc <flag> Pass flag through to all compiler instantiations " )
33
34
print ( " -Xlinker <flag> Pass flag through to all linker instantiations " )
35
+ print ( " --get Only pull down dependencies without building binaries " )
34
36
}
35
37
36
38
enum CleanMode : String {
@@ -41,6 +43,7 @@ enum CleanMode: String {
41
43
enum Mode {
42
44
case Build( Configuration )
43
45
case Clean( CleanMode )
46
+ case Fetch
44
47
case Init
45
48
case Usage
46
49
case Version
@@ -132,6 +135,8 @@ func parse(commandLineArguments args: [String]) throws -> (Mode, Options) {
132
135
}
133
136
case ( nil , . Version) :
134
137
mode = . Version
138
+ case ( nil , . Fetch) :
139
+ mode = . Fetch
135
140
}
136
141
137
142
case . Switch( . Chdir) :
@@ -171,6 +176,7 @@ extension Mode: CustomStringConvertible {
171
176
switch self {
172
177
case . Build( let conf) : return " --build \( conf) "
173
178
case . Clean( let cleanMode) : return " --clean= \( cleanMode) "
179
+ case . Fetch: return " --fetch "
174
180
case . Init: return " --init "
175
181
case . Usage: return " --help "
176
182
case . Version: return " --version "
@@ -184,6 +190,7 @@ private struct Cruncher {
184
190
enum TheMode : String {
185
191
case Build = " --configuration "
186
192
case Clean = " --clean "
193
+ case Fetch = " --fetch "
187
194
case Init = " --init "
188
195
case Usage = " --help "
189
196
case Version = " --version "
@@ -279,6 +286,7 @@ private func ==(lhs: Mode, rhs: Cruncher.Crunch.TheMode) -> Bool {
279
286
switch lhs {
280
287
case . Build: return rhs == . Build
281
288
case . Clean: return rhs == . Clean
289
+ case . Fetch: return rhs == . Fetch
282
290
case . Init: return rhs == . Init
283
291
case . Version: return rhs == . Version
284
292
case . Usage: return rhs == . Usage
0 commit comments