C# Class PowerArgs.CommandLineArgument

Instances of this class represent a single command line argument that users can specify on the command line. Supported syntaxes include: -argumentName argumentValue /argumentName:argumentValue -argumentName - If the argument is a boolean it will be true in this case. --argumentName=argumentValue - Only works if you have added an alias that starts with --. argumentValue - Only works if this argument defines the Position property as >= 0
Datei anzeigen Open project: adamabdelhamed/PowerArgs Class Usage Examples

Private Properties

Property Type Description
CommandLineArgument System
Create CommandLineArgument
Create CommandLineArgument
FindDefaultShortcuts List
FindMatchingArgumentInRawParseData void
GenerateShortcutAlias string
GetTypeNameWithGenericsStripped string
IsArgument bool
IsArgument bool
IsMatch bool
MapTypeName string
Populate void
PopulateArguments void
Revive void
RunAfterPopulateProperty void
RunArgumentHook void
RunBeforePopulateProperty void
Validate void

Public Methods

Method Description
CommandLineArgument ( Type t, string defaultAlias, bool ignoreCase = true ) : System

Creates a command line argument of the given type and sets the first default alias.

TestIsValidAndRevivable ( string value ) : bool

Tests to see if the given value would pass validation and revival.

ToString ( ) : string

Gets the string representation of this argument.

Private Methods

Method Description
CommandLineArgument ( ) : System
Create ( ParameterInfo parameter ) : CommandLineArgument
Create ( PropertyInfo property, List knownAliases ) : CommandLineArgument
FindDefaultShortcuts ( PropertyInfo info, List knownShortcuts, bool ignoreCase ) : List
FindMatchingArgumentInRawParseData ( PowerArgs.ArgHook context ) : void
GenerateShortcutAlias ( string baseAlias, List excluded, bool ignoreCase ) : string
GetTypeNameWithGenericsStripped ( Type t ) : string
IsArgument ( ParameterInfo parameter ) : bool
IsArgument ( PropertyInfo property ) : bool
IsMatch ( string key ) : bool
MapTypeName ( Type t ) : string
Populate ( PowerArgs.ArgHook context ) : void
PopulateArguments ( List arguments, PowerArgs.ArgHook context ) : void
Revive ( string commandLineValue ) : void
RunAfterPopulateProperty ( PowerArgs.ArgHook context ) : void
RunArgumentHook ( PowerArgs.ArgHook context, int>.Func orderby, Action hookAction ) : void
RunBeforePopulateProperty ( PowerArgs.ArgHook context ) : void
Validate ( string &commandLineValue ) : void

Method Details

CommandLineArgument() public method

Creates a command line argument of the given type and sets the first default alias.
public CommandLineArgument ( Type t, string defaultAlias, bool ignoreCase = true ) : System
t System.Type The CLR type of the argument
defaultAlias string The default name that users will use to specify this argument
ignoreCase bool If true, the parser will match this argument even if the specifier doesn't match case. True by default.
return System

TestIsValidAndRevivable() public method

Tests to see if the given value would pass validation and revival.
public TestIsValidAndRevivable ( string value ) : bool
value string the value to test
return bool

ToString() public method

Gets the string representation of this argument.
public ToString ( ) : string
return string