C# 클래스 ToolBelt.CommandLineParser

Command line parser.
파일 보기 프로젝트 열기: jlyonsmith/ToolBelt 1 사용 예제들

공개 메소드들

메소드 설명
CommandLineParser ( object argTarget, Type resourceReaderType = null, CommandLineParserFlags flags = CommandLineParserFlags.Default ) : System

Initializes a new instance of the CommandLineParser class. Provides a resource reader for localization of the command line arguments. String specified in the command line attributes are used to look up corresponding localized strings in the resources. Also provides flags to control parsing.

GetArgumentString ( ) : string

Gets all set arguments in the target as a valid command line string

GetUsage ( string command ) : string

Gets the usage string for a specific command.

GetUsage ( string command, int lineLength ) : string

Gets the usage string for a specific command.

ParseAndSetTarget ( IEnumerable argStrings ) : void

Parses the supplied command line arguments and sets the target objects properties.

비공개 메소드들

메소드 설명
ExternalGetString ( string s ) : string
GetCommandHelpLines ( int lineLength, StringBuilder helpText ) : void
GetDefaultArgumentValueHint ( string command ) : string
GetDescriptionHelpLines ( string command, int lineLength, StringBuilder helpText ) : void
GetExampleHelpLines ( int lineLength, StringBuilder helpText ) : void
GetSwitchesHelpLines ( string command, int lineLength, StringBuilder helpText ) : void
GetSyntaxHelpLine ( string command, StringBuilder helpText ) : void
GetUnprocessedArgumentValueHint ( string command ) : string
HasArguments ( string command ) : bool
IsValidArgumentForCommand ( CommandLineArgument argument, string command ) : bool

Is the argument valid of for this command?

IsValidCommand ( string command ) : bool

Is this a valid command.

LazyGenerateCommandArguments ( ) : void

메소드 상세

CommandLineParser() 공개 메소드

Initializes a new instance of the CommandLineParser class. Provides a resource reader for localization of the command line arguments. String specified in the command line attributes are used to look up corresponding localized strings in the resources. Also provides flags to control parsing.
is a null reference.
public CommandLineParser ( object argTarget, Type resourceReaderType = null, CommandLineParserFlags flags = CommandLineParserFlags.Default ) : System
argTarget object The into which the command line arguments are placed.
resourceReaderType System.Type A resource reader object with a GetString method
flags CommandLineParserFlags See .
리턴 System

GetArgumentString() 공개 메소드

Gets all set arguments in the target as a valid command line string
public GetArgumentString ( ) : string
리턴 string

GetUsage() 공개 메소드

Gets the usage string for a specific command.
public GetUsage ( string command ) : string
command string The command for which to obtain usage. Pass null to obtain default usage.
리턴 string

GetUsage() 공개 메소드

Gets the usage string for a specific command.
public GetUsage ( string command, int lineLength ) : string
command string The command for which to obtain usage. Pass null to obtain default usage.
lineLength int /// Number of columns to format the output for. Pass -1 to format for the active console. /// If there is no console window the default will be 79. Any line length below 39 is rounded up to 39. ///
리턴 string

ParseAndSetTarget() 공개 메소드

Parses the supplied command line arguments and sets the target objects properties.
public ParseAndSetTarget ( IEnumerable argStrings ) : void
argStrings IEnumerable
리턴 void