mas/mas-cli/Commands/Version.swift
2016-09-24 15:53:50 +01:00

21 lines
554 B
Swift

//
// Version.swift
// mas-cli
//
// Created by Andrew Naylor on 20/09/2015.
// Copyright © 2015 Andrew Naylor. All rights reserved.
//
struct VersionCommand: CommandProtocol {
typealias Options = NoOptions<MASError>
let verb = "version"
let function = "Print version number"
func run(_ options: Options) -> Result<(), MASError> {
let plist = Bundle.main.infoDictionary
if let versionString = plist?["CFBundleShortVersionString"] {
print(versionString)
}
return .success(())
}
}