0001 // 0002 // VersionCommand.swift 0003 // Example 0004 // 0005 // Created by Jake Heiser on 8/2/14. 0006 // Copyright (c) 2014 jakeheis. All rights reserved. 0007 // 0008 0009 public class VersionCommand: CommandType { 0010 0011 public var commandName: String { 0012 return "version" 0013 } 0014 0015 public var commandSignature: String { 0016 return "" 0017 } 0018 0019 public var commandShortDescription: String { 0020 return "Prints the current version of this app" 0021 } 0022 0023 public var commandShortcut: String? { 0024 return "-v" 0025 } 0026 0027 public func execute(arguments: CommandArguments) throws { 0028 print("Version: \(CLI.appVersion)") 0029 } 0030 0031 }
CLI.swift:20 public static var versionComand: CommandType? = VersionCommand()