C# 클래스 PowerArgs.Cli.PowerArgsRichCommandLineReader

A customized version of the RichTextCommandLineReader that configures tab completion, history, and syntax highlighting for a given command line arguments definition.
상속: RichTextCommandLineReader, ITabCompletionHandler
파일 보기 프로젝트 열기: adamabdelhamed/PowerArgs 1 사용 예제들

공개 메소드들

메소드 설명
FindContextualAction ( string firstToken, CommandLineArgumentsDefinition def = null ) : CommandLineAction

Finds the action that matches the given token in the given definition

FindContextualArgument ( string previousToken, CommandLineAction contextualAction, CommandLineArgumentsDefinition def = null ) : System.CommandLineArgument

A helper that detects the argument represented by the current token given a definition.

FindCurrentTokenArgument ( CommandLineAction contextualAction, string currentToken, bool &expectMatchingArg, CommandLineArgumentsDefinition def = null ) : System.CommandLineArgument

A helper that detects the argument represented by the current token given a definition.

FindPreviousNonWhitespaceToken ( RichCommandLineContext readerContext, HighlighterContext highlighterContext ) : string

Searches the reader's tokens for a non whitespace token that preceeds the current token

PowerArgsRichCommandLineReader ( CommandLineArgumentsDefinition definition, List history ) : System

Configures the reader for the given definition and history information.

TryTabComplete ( RichCommandLineContext cliContext ) : bool

Implementation of tab completion that leverages tab completion sources that are registered with the target definition.

비공개 메소드들

메소드 설명
ConvertContext ( CommandLineArgumentsDefinition definition, RichCommandLineContext innerContext ) : TabCompletionContext
FindNewTabCompletionHooks ( CommandLineArgumentsDefinition definition ) : IEnumerable
FindOldTabCompletionHooks ( CommandLineArgumentsDefinition definition ) : IEnumerable
InitHighlighters ( ) : void
PassThroughOrTryGetAmbientDefinition ( CommandLineArgumentsDefinition def ) : CommandLineArgumentsDefinition

메소드 상세

FindContextualAction() 공개 정적인 메소드

Finds the action that matches the given token in the given definition
public static FindContextualAction ( string firstToken, CommandLineArgumentsDefinition def = null ) : CommandLineAction
firstToken string the token to test. If you pass null you will get null back.
def CommandLineArgumentsDefinition The definition to inspect. If null, the ambient definition will be used. If there is no ambient definition and null is passed then this method throws a NullReferenceException.
리턴 CommandLineAction

FindContextualArgument() 공개 정적인 메소드

A helper that detects the argument represented by the current token given a definition.
public static FindContextualArgument ( string previousToken, CommandLineAction contextualAction, CommandLineArgumentsDefinition def = null ) : System.CommandLineArgument
previousToken string The token to inspect. If you pass null you will get null back.
contextualAction CommandLineAction An action to inspect for a match if the current token does not match a global argument. Pass null to only check global arguments.
def CommandLineArgumentsDefinition The definition to inspect. If null, the ambient definition will be used. If there is no ambient definition and null is passed then this method throws a NullReferenceException.
리턴 System.CommandLineArgument

FindCurrentTokenArgument() 공개 정적인 메소드

A helper that detects the argument represented by the current token given a definition.
public static FindCurrentTokenArgument ( CommandLineAction contextualAction, string currentToken, bool &expectMatchingArg, CommandLineArgumentsDefinition def = null ) : System.CommandLineArgument
contextualAction CommandLineAction An action to inspect for a match if the current token does not match a global argument. Pass null to only check global arguments.
currentToken string The token to inspect. If you pass null you will get null back.
expectMatchingArg bool This will be set to true if the current token starts with a '-' or a '/' meaning that the token was an argument indicator, even if it didn't match an argument in the definition.
def CommandLineArgumentsDefinition The definition to inspect. If null, the ambient definition will be used. If there is no ambient definition and null is passed then this method throws a NullReferenceException.
리턴 System.CommandLineArgument

FindPreviousNonWhitespaceToken() 공개 정적인 메소드

Searches the reader's tokens for a non whitespace token that preceeds the current token
public static FindPreviousNonWhitespaceToken ( RichCommandLineContext readerContext, HighlighterContext highlighterContext ) : string
readerContext RichCommandLineContext the reader context to inspect
highlighterContext HighlighterContext the highlighter context to inspect
리턴 string

PowerArgsRichCommandLineReader() 공개 메소드

Configures the reader for the given definition and history information.
public PowerArgsRichCommandLineReader ( CommandLineArgumentsDefinition definition, List history ) : System
definition CommandLineArgumentsDefinition The definition to use to configure the reader
history List previous command line values that the end user will be able to cycle through using the up and down arrows
리턴 System

TryTabComplete() 공개 메소드

Implementation of tab completion that leverages tab completion sources that are registered with the target definition.
public TryTabComplete ( RichCommandLineContext cliContext ) : bool
cliContext RichCommandLineContext cintext used internally
리턴 bool