Group

public struct Group : Commands

Group multiple Commands together, optionally providing a group prefix.

Group("admin") {
    // Admin prefixed commands
}
  • Group prefix

    Declaration

    Swift

    public let name: String?
  • Declaration

    Swift

    public func executables() -> [_ExecutableCommand]
  • Add a group prefix to these commands.

    NOTE: Only one group prefix is supported. So calling .group(_:) on a Group will not do anything

    Declaration

    Swift

    public func group(_ group: String) -> Group
  • Create a new Group

    Declaration

    Swift

    public init(_ name: String? = nil, @CommandBuilder commands: () -> Commands)

    Parameters

    name

    Optionally provide a group prefix. All commands in this group will be prefixed with this.

    commands

    Commands in this group.