C# 클래스 PowerArgs.CommandLineArgumentsDefinition

This is the root class used to define a program's command line arguments. You can start with an empty definition and programatically add arguments or you can start from a Type that you have defined and have the definition inferred from it.
파일 보기 프로젝트 열기: adamabdelhamed/PowerArgs 1 사용 예제들

공개 메소드들

메소드 설명
Clean ( ) : void

Resets all portions of the model that may have side effects from being run through the argument processor.

CommandLineArgumentsDefinition ( ) : System

Creates an empty command line arguments definition.

CommandLineArgumentsDefinition ( Type t ) : System

Creates a command line arguments definition and infers things like Arguments, Actions, etc. from the type's metadata.

CreateVariableResolver ( ) : IBooleanVariableResolver

Gives you an object that you can use to tell if a particular argument was specified on the command line.

FindArgumentByPosition ( int position, string action = null ) : CommandLineArgument

Finds the command line argument that is allowed to be specified in the given position (zero based). You can also pass an action name if you know the context of a targeted action.

FindMatchingAction ( string key, bool throwIfMoreThanOneMatch = false ) : CommandLineAction

Finds the first CommandLineAction that matches the given key

FindMatchingArgument ( string key, bool throwIfMoreThanOneMatch = false ) : CommandLineArgument

Finds the first CommandLineArgument that matches the given key.

ToString ( ) : string

Gets a basic string representation of the definition.

비공개 메소드들

메소드 설명
FindCommandLineActions ( Type t ) : List
FindCommandLineArguments ( Type t ) : List
FindMatchingArgument ( string key, bool throwIfMoreThanOneMatch, IEnumerable searchSpace ) : CommandLineArgument
MakeUsageSummary ( bool htmlEncodeBrackets = false ) : string
SetPropertyValues ( object o ) : void
Validate ( PowerArgs.ArgHook context ) : void
ValidateActionAliases ( ) : void
ValidateArguments ( IEnumerable arguments ) : void

메소드 상세

Clean() 공개 메소드

Resets all portions of the model that may have side effects from being run through the argument processor.
public Clean ( ) : void
리턴 void

CommandLineArgumentsDefinition() 공개 메소드

Creates an empty command line arguments definition.
public CommandLineArgumentsDefinition ( ) : System
리턴 System

CommandLineArgumentsDefinition() 공개 메소드

Creates a command line arguments definition and infers things like Arguments, Actions, etc. from the type's metadata.
public CommandLineArgumentsDefinition ( Type t ) : System
t System.Type The argument scaffold type used to infer the definition
리턴 System

CreateVariableResolver() 공개 메소드

Gives you an object that you can use to tell if a particular argument was specified on the command line.
public CreateVariableResolver ( ) : IBooleanVariableResolver
리턴 IBooleanVariableResolver

FindArgumentByPosition() 공개 메소드

Finds the command line argument that is allowed to be specified in the given position (zero based). You can also pass an action name if you know the context of a targeted action.
public FindArgumentByPosition ( int position, string action = null ) : CommandLineArgument
position int the position of the argument
action string optionally specify the name of an action which may also have positional arguments defined
리턴 CommandLineArgument

FindMatchingAction() 공개 메소드

Finds the first CommandLineAction that matches the given key
public FindMatchingAction ( string key, bool throwIfMoreThanOneMatch = false ) : CommandLineAction
key string The key as if it was typed in on the command line. This can also be an alias.
throwIfMoreThanOneMatch bool If set to true then this method will throw and InvalidArgDeginitionException if more than 1 match is found
리턴 CommandLineAction

FindMatchingArgument() 공개 메소드

Finds the first CommandLineArgument that matches the given key.
public FindMatchingArgument ( string key, bool throwIfMoreThanOneMatch = false ) : CommandLineArgument
key string The key as if it was typed in on the command line. This can also be an alias.
throwIfMoreThanOneMatch bool If set to true then this method will throw and InvalidArgDeginitionException if more than 1 match is found
리턴 CommandLineArgument

ToString() 공개 메소드

Gets a basic string representation of the definition.
public ToString ( ) : string
리턴 string