feat: Updating command options.

This commit is contained in:
2024-12-24 10:39:56 -05:00
parent f2a2374c4f
commit 8aa4b73cab
12 changed files with 249 additions and 328 deletions

View File

@@ -7,38 +7,10 @@ extension CliVersionCommand {
struct Build: AsyncParsableCommand {
static let configuration: CommandConfiguration = .init(
abstract: "Used for the build with version plugin.",
discussion: "This should generally not be interacted with directly, outside of the build plugin.",
subcommands: [BranchStyle.self, SemVarStyle.self],
defaultSubcommand: SemVarStyle.self
)
}
}
extension CliVersionCommand.Build {
struct BranchStyle: AsyncParsableCommand {
static let configuration: CommandConfiguration = .init(
commandName: "branch",
abstract: "Build using branch and commit sha as the version.",
discussion: "This should generally not be interacted with directly, outside of the plugin usage context."
discussion: "This should generally not be interacted with directly, outside of the build plugin."
)
@OptionGroup var globals: GlobalBranchOptions
func run() async throws {
try await globals.shared().run(\.build)
}
}
struct SemVarStyle: AsyncParsableCommand {
static let configuration: CommandConfiguration = .init(
commandName: "semvar",
abstract: "Generates a version file with SemVar style.",
discussion: "This should generally not be interacted with directly, outside of the plugin usage context."
)
@OptionGroup var globals: GlobalSemVarOptions
@OptionGroup var globals: GlobalOptions
func run() async throws {
try await globals.shared().run(\.build)