Arguments

public class Arguments

Arguments container used in ArrayArgCommand.

  • Resolve an argument from the command arguments

    let reason = try args.get(String.self, named: "reason", on: event)
    

    Throws

    CommandError.UnableToConvertArgument when resolving fails. CommandError.ArgumentNotFound when no argument is found.

    Declaration

    Swift

    public func get<A>(_ arg: A.Type, named name: String, on event: CommandEvent) throws -> A.ResolvedArgument where A : CommandArgumentConvertible

    Parameters

    arg

    Type to resolve.

    name

    Name of the argument to resolve.

    event

    CommandEvent to resolve on.

    Return Value

    The resolved argument.