34 lines
933 B
Swift
34 lines
933 B
Swift
import ArgumentParser
|
|
|
|
public extension CommandConfiguration {
|
|
|
|
/// Use `NodeBuilder` syntax for generating the abstract and discussion parameters.
|
|
init(
|
|
commandName: String? = nil,
|
|
abstract: Abstract,
|
|
usage: String? = nil,
|
|
discussion: Discussion,
|
|
version: String = "",
|
|
shouldDisplay: Bool = true,
|
|
subcommands: [any ParsableCommand.Type] = [],
|
|
groupedSubcommands: [CommandGroup] = [],
|
|
defaultSubcommand: ParsableCommand.Type? = nil,
|
|
helpNames: NameSpecification? = nil,
|
|
aliases: [String] = []
|
|
) {
|
|
self.init(
|
|
commandName: commandName,
|
|
abstract: abstract.render(),
|
|
usage: usage,
|
|
discussion: discussion.render(),
|
|
version: version,
|
|
shouldDisplay: shouldDisplay,
|
|
subcommands: subcommands,
|
|
groupedSubcommands: groupedSubcommands,
|
|
defaultSubcommand: defaultSubcommand,
|
|
helpNames: helpNames,
|
|
aliases: aliases
|
|
)
|
|
}
|
|
}
|