Skip to main content

CommandSearchResult

A struct in Root.Township, Alta.Console.

The outcome of matching console input to a command: which command was found, whether its arguments fit, and the parsed arguments.

Constructors​

MemberWhat it is
CommandSearchResult(CommandResultSuccess success, Command command, object[] arguments = null)Creates a CommandSearchResult from success, command and arguments.

Fields​

MemberWhat it is
object[] argumentsThe parsed argument values, ready to pass to the command. Null on failure results.
Command commandThe command the input matched, even when the match failed on its arguments.
CommandResultSuccess successWhether the match worked, or which way it failed.

Methods​

MemberWhat it is
static CommandSearchResult IncorrectParameterTypes(Command command)Makes a failed result for a command whose arguments didn't match its parameter types.
static CommandSearchResult NotEnoughParameters(Command command)Makes a failed result for a command that was given too few arguments.
static CommandSearchResult ParameterParsingFailure(Command command)Makes a failed result for a command whose arguments couldn't be parsed.
static CommandSearchResult Success(Command command, object[] arguments)Makes a successful result holding the command and its parsed arguments.
static CommandSearchResult TooManyParameters(Command command)Makes a failed result for a command that was given too many arguments.

Used in​

Members of other types that take, return or hold a CommandSearchResult: