forked from yonaskolb/XcodeGen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXcodeGenCLI.swift
More file actions
34 lines (30 loc) · 864 Bytes
/
XcodeGenCLI.swift
File metadata and controls
34 lines (30 loc) · 864 Bytes
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
import Foundation
import ProjectSpec
import SwiftCLI
import Version
public class XcodeGenCLI {
let cli: CLI
public init(version: Version) {
let generateCommand = GenerateCommand(version: version)
cli = CLI(
name: "xcodegen",
version: version.description,
description: "Generates Xcode projects",
commands: [
generateCommand,
CacheCommand(version: version),
DumpCommand(version: version),
]
)
cli.parser.routeBehavior = .searchWithFallback(generateCommand)
}
public func execute(arguments: [String]? = nil) {
let status: Int32
if let arguments = arguments {
status = cli.go(with: arguments)
} else {
status = cli.go()
}
exit(status)
}
}