feat: Working on command-line documentation.
Some checks failed
CI / Ubuntu (push) Has been cancelled

This commit is contained in:
2024-12-27 14:51:55 -05:00
parent 8d73287a60
commit 4420bd428a
28 changed files with 674 additions and 80 deletions

View 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 {}