@@ -18,11 +18,11 @@ func usage(print: (String) -> Void = { print($0) }) {
18
18
print ( " USAGE: swift build [options] " )
19
19
print ( " " )
20
20
print ( " MODES: " )
21
- print ( " --configuration <value> Build with configuration (debug|release) [-c] " )
22
- print ( " --clean[=<mode>] Delete artefacts (build|dist) [-k] " )
23
- print ( " --init <mode> Creates a new Swift package (executable|library) " )
24
- print ( " --fetch Fetch package dependencies " )
25
- print ( " --generate-xcodeproj Generates an Xcode project for this package [-X] " )
21
+ print ( " --configuration <value> Build with configuration (debug|release) [-c] " )
22
+ print ( " --clean[=<mode>] Delete artefacts (build|dist) [-k] " )
23
+ print ( " --init <mode> Creates a new Swift package (executable|library) " )
24
+ print ( " --fetch Fetch package dependencies " )
25
+ print ( " --generate-xcodeproj [<path>] Generates an Xcode project for this package [-X] " )
26
26
print ( " " )
27
27
print ( " OPTIONS: " )
28
28
print ( " --chdir <value> Change working directory before any other operation [-C] " )
@@ -44,7 +44,7 @@ enum Mode {
44
44
case Init( InitPackage . InitMode )
45
45
case Usage
46
46
case Version
47
- case GenerateXcodeproj
47
+ case GenerateXcodeproj( String ? )
48
48
}
49
49
50
50
struct Options {
@@ -148,7 +148,14 @@ func parse(commandLineArguments args: [String]) throws -> (Mode, Options) {
148
148
case ( nil , . Fetch) :
149
149
mode = . Fetch
150
150
case ( nil , . GenerateXcodeproj) :
151
- mode = . GenerateXcodeproj
151
+ mode = . GenerateXcodeproj( nil )
152
+ switch try cruncher. peek ( ) {
153
+ case . Name( let path) ? :
154
+ mode = . GenerateXcodeproj( path)
155
+ cruncher. postPeekPop ( )
156
+ default :
157
+ break
158
+ }
152
159
}
153
160
154
161
case . Switch( . Chdir) :
0 commit comments