2015-09-20 10:40:55 +00:00
|
|
|
//
|
|
|
|
// Version.swift
|
|
|
|
// mas-cli
|
|
|
|
//
|
|
|
|
// Created by Andrew Naylor on 20/09/2015.
|
|
|
|
// Copyright © 2015 Andrew Naylor. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
struct VersionCommand: CommandType {
|
2015-12-30 21:20:25 +00:00
|
|
|
typealias Options = NoOptions<MASError>
|
2015-09-20 10:40:55 +00:00
|
|
|
let verb = "version"
|
2015-09-20 22:33:55 +00:00
|
|
|
let function = "Print version number"
|
2015-09-20 10:40:55 +00:00
|
|
|
|
2015-12-30 21:20:25 +00:00
|
|
|
func run(options: Options) -> Result<(), MASError> {
|
|
|
|
let plist = NSBundle.mainBundle().infoDictionary
|
|
|
|
if let versionString = plist?["CFBundleShortVersionString"] {
|
|
|
|
print(versionString)
|
2015-09-20 10:40:55 +00:00
|
|
|
}
|
|
|
|
return .Success(())
|
|
|
|
}
|
|
|
|
}
|