mirror of
https://github.com/mas-cli/mas
synced 2024-11-23 20:13:19 +00:00
afca0c6c50
Commands install, list, lucky, outdated, uninstall, upgrade
27 lines
696 B
Swift
27 lines
696 B
Swift
//
|
|
// Version.swift
|
|
// mas-cli
|
|
//
|
|
// Created by Andrew Naylor on 20/09/2015.
|
|
// Copyright © 2015 Andrew Naylor. All rights reserved.
|
|
//
|
|
|
|
import Commandant
|
|
import Result
|
|
|
|
/// Command which displays the version of the mas tool.
|
|
public struct VersionCommand: CommandProtocol {
|
|
public typealias Options = NoOptions<MASError>
|
|
public let verb = "version"
|
|
public let function = "Print version number"
|
|
|
|
public init() {}
|
|
|
|
public func run(_ options: Options) -> Result<(), MASError> {
|
|
let plist = Bundle.main.infoDictionary
|
|
if let versionString = plist?["CFBundleShortVersionString"] {
|
|
print(versionString)
|
|
}
|
|
return .success(())
|
|
}
|
|
}
|