Show / Hide Table of Contents

Class CommandParser

Parses a space-delimited string into a structured Command object for a specific CommandPalette.

Inheritance
object
CommandParser
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Petabridge.Cmd
Assembly: Petabridge.Cmd.Common.dll
Syntax
public class CommandParser

Constructors

CommandParser(CommandPalette)

Declaration
public CommandParser(CommandPalette palette)
Parameters
Type Name Description
CommandPalette palette

Fields

HelpCommand

Declaration
public const string HelpCommand = "help"
Field Value
Type Description
string

UnknownCommand

Declaration
public const string UnknownCommand = "unknown"
Field Value
Type Description
string

Properties

Palette

The set of commands supported by this parser.

Declaration
public CommandPalette Palette { get; }
Property Value
Type Description
CommandPalette

Validator

The validator for this parser.

Declaration
public CommandValidator Validator { get; }
Property Value
Type Description
CommandValidator

Methods

Parse(string)

Parses a full command-line argument into its resultant parts.

Declaration
public ParseResult Parse(string commandLine)
Parameters
Type Name Description
string commandLine

The commandline to tokenize.

Returns
Type Description
ParseResult

A ParseResult structure indicating if the object was correctly formed into a valid, recognizable Command belonging to this CommandPalette.

Parse(string[])

Parses an incoming string into a Command belonging to Palette.

Declaration
public ParseResult Parse(string[] args)
Parameters
Type Name Description
string[] args

Tokenized commandline arguments

Returns
Type Description
ParseResult

A ParseResult structure indicating if the object was correctly formed into a valid, recognizable Command belonging to this CommandPalette.

In this article
Back to top Generated by DocFX