Files
swift-hpa/Sources/hpa/VaultCommands/DecryptCommand.swift

34 lines
688 B
Swift

import ArgumentParser
import CliClient
import Dependencies
import VaultClient
struct DecryptCommand: AsyncParsableCommand {
static let commandName = "decrypt"
static let configuration = CommandConfiguration(
commandName: commandName,
abstract: createAbstract("Decrypt a vault file.")
)
@Option(
name: .shortAndLong,
help: "Output file."
)
var output: String?
@OptionGroup var options: VaultOptions
mutating func run() async throws {
@Dependency(\.vaultClient) var vaultClient
let output = try await vaultClient.run.decrypt(options.runOptions(
commandName: Self.commandName,
outputFilePath: output
))
print(output)
}
}