     case .Build:   target.config(); target.build()
     case .Test:    target.test()
     case .Clean:   target.clean()
+    case .Version: nextVersion()
     }
 }
 


import Darwin
import Foundation

enum Task: String {
    case Config  = "config"

    print("  target ... production|sandbox")
}

func nextVersion() {
    print("-------- increment versions --------")
    let currentVersion = Int(shell("agvtool what-version -terse").trim())!
    run("agvtool next-version", silent: true)
    print("update bundle version: \(currentVersion) -> \(currentVersion + 1)")
    print("-------- update version strings  --------")
    run("agvtool new-marketing-version \(version)", silent: true)
}

func main(task task: Task, target: Target) {
    switch task {
    case .Config:  target.config()
