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.
- Listed in Console, logging and analytics
Constructors
| Member | What it is |
|---|---|
CommandSearchResult(CommandResultSuccess success, Command command, object[] arguments = null) | Creates a CommandSearchResult from success, command and arguments. |
Fields
| Member | What it is |
|---|---|
object[] arguments | The parsed argument values, ready to pass to the command. Null on failure results. |
Command command | The command the input matched, even when the match failed on its arguments. |
CommandResultSuccess success | Whether the match worked, or which way it failed. |
Methods
| Member | What 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:
Command.AreParametersViable, Command.GetCommandsInternal, CommandCollection.Search, CommandPart.GetCommands, CommandPart.GetCommandsInternal, RepeatCommandModule.Handler, RepeatCommandModule.Repeat, CommandService.CustomHandler, CommandService.HandleMatchedCommand, CommandService.LastCommand, CommandService.Search, Module.GetCommandsInternal.