Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
Add version flag
Browse files Browse the repository at this point in the history
This is natively supported in later version of Commander, but until
there is a PathKit update, we cannot use it because of a shared
dependency with mismatched versions.

For some reason you can't use --version here even though --help says you
can, you have to use -v instead.
  • Loading branch information
keith committed Oct 18, 2017
1 parent b2c0a41 commit b17a7f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Sources/XcodeGen/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ import ProjectSpec
import JSONUtilities
import Rainbow

func generate(spec: String, project: String) {
func generate(spec: String, project: String, printVersion: Bool) {
if printVersion {
print("1.2.4")
return
}

let specPath = Path(spec).normalize()
let projectPath = Path(project).normalize()
Expand Down Expand Up @@ -51,5 +55,6 @@ func generate(spec: String, project: String) {
command(
Option<String>("spec", "project.yml", flag: "s", description: "The path to the spec file"),
Option<String>("project", "", flag: "p", description: "The path to the folder where the project should be generated"),
Flag("version", flag: "v", description: "The current XcodeGen version"),
generate)
.run()

0 comments on commit b17a7f2

Please sign in to comment.