feat: Integrates cli-client dependency into cli-version executable
This commit is contained in:
28
Sources/cli-version/BumpCommand.swift
Normal file
28
Sources/cli-version/BumpCommand.swift
Normal file
@@ -0,0 +1,28 @@
|
||||
import ArgumentParser
|
||||
import CliVersion
|
||||
import Dependencies
|
||||
|
||||
extension CliVersionCommand {
|
||||
struct Bump: AsyncParsableCommand {
|
||||
|
||||
static let configuration = CommandConfiguration(
|
||||
commandName: "bump",
|
||||
abstract: "Bump version of a command-line tool."
|
||||
)
|
||||
|
||||
@OptionGroup var globals: GlobalOptions
|
||||
|
||||
@Flag
|
||||
var bumpOption: CliClient.BumpOption = .patch
|
||||
|
||||
func run() async throws {
|
||||
try await globals.run {
|
||||
@Dependency(\.cliClient) var cliClient
|
||||
let output = try await cliClient.bump(bumpOption, globals.shared)
|
||||
print(output)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension CliClient.BumpOption: EnumerableFlag {}
|
||||
Reference in New Issue
Block a user