feat: Working on command-line documentation.
Some checks failed
CI / Ubuntu (push) Has been cancelled
Some checks failed
CI / Ubuntu (push) Has been cancelled
This commit is contained in:
40
Sources/BumpVersion/Commands/BumpCommand.swift
Normal file
40
Sources/BumpVersion/Commands/BumpCommand.swift
Normal file
@@ -0,0 +1,40 @@
|
||||
import ArgumentParser
|
||||
import CliClient
|
||||
import CliDoc
|
||||
import Dependencies
|
||||
|
||||
struct BumpCommand: CommandRepresentable {
|
||||
|
||||
static let commandName = "bump"
|
||||
|
||||
static let configuration = CommandConfiguration(
|
||||
commandName: Self.commandName,
|
||||
abstract: Abstract.default("Bump version of a command-line tool."),
|
||||
usage: Usage.default(commandName: nil),
|
||||
discussion: Discussion.default(examples: [
|
||||
makeExample(
|
||||
label: "Basic usage, bump the minor version.",
|
||||
example: "--minor"
|
||||
),
|
||||
makeExample(
|
||||
label: "Dry run, just show what the bumped version would be.",
|
||||
example: "--minor --dry-run"
|
||||
)
|
||||
])
|
||||
)
|
||||
|
||||
@OptionGroup var globals: GlobalOptions
|
||||
|
||||
@Flag(
|
||||
help: """
|
||||
The semvar bump option, this is ignored if the configuration is set to use a branch/commit sha strategy.
|
||||
"""
|
||||
)
|
||||
var bumpOption: CliClient.BumpOption = .patch
|
||||
|
||||
func run() async throws {
|
||||
try await globals.run(\.bump, command: Self.commandName, args: bumpOption)
|
||||
}
|
||||
}
|
||||
|
||||
extension CliClient.BumpOption: EnumerableFlag {}
|
||||
Reference in New Issue
Block a user