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.
|
|
|
|
//
|
|
|
|
|
2018-07-04 20:56:10 +00:00
|
|
|
import Commandant
|
|
|
|
|
2018-12-28 22:08:31 +00:00
|
|
|
/// Command which displays the version of the mas tool.
|
2018-10-14 21:35:48 +00:00
|
|
|
public struct VersionCommand: CommandProtocol {
|
|
|
|
public typealias Options = NoOptions<MASError>
|
|
|
|
public let verb = "version"
|
|
|
|
public let function = "Print version number"
|
|
|
|
|
|
|
|
public init() {}
|
|
|
|
|
2019-01-12 01:28:03 +00:00
|
|
|
/// Runs the command.
|
2021-03-22 05:46:17 +00:00
|
|
|
public func run(_: Options) -> Result<Void, MASError> {
|
2021-05-08 20:26:25 +00:00
|
|
|
print(Package.version)
|
2016-09-17 12:58:38 +00:00
|
|
|
return .success(())
|
2015-09-20 10:40:55 +00:00
|
|
|
}
|
|
|
|
}
|