Files
SideStore/SideStoreApp/Sources/Cargo/Commands/Version.swift

25 lines
695 B
Swift
Raw Normal View History

2023-03-01 00:48:36 -05:00
import ArgumentParser
import SwiftLintFramework
2023-03-02 00:40:11 -05:00
import os.log
2023-03-01 00:48:36 -05:00
extension Cargo {
struct Version: ParsableCommand {
@Flag(help: "Display full version info")
var verbose = false
static let configuration = CommandConfiguration(abstract: "Display the current version of Cargo")
static var value: String { "TODO" }
func run() throws {
if verbose, let buildID = ExecutableInfo.buildID {
2023-03-02 00:40:11 -05:00
os_log("Version: %@", type: .info , Self.value)
os_log("Build ID: %@", type: .info , buildID)
2023-03-01 00:48:36 -05:00
} else {
print(Self.value)
}
ExitHelper.successfullyExit()
}
}
}