C# Class PowerArgs.CommandLineAction

A class that represents command line actions that users can specify on the command line. This is useful for programs like git where users first specify an action like 'push' and then the remaining arguments are either global or specific to 'push'.
Afficher le fichier Open project: adamabdelhamed/PowerArgs Class Usage Examples

Private Properties

Свойство Type Description
CommandLineAction System
Create CommandLineAction
Create CommandLineAction
IsActionImplementation bool
IsActionImplementation bool
IsMatch bool
MakeUsageSummary string
PopulateArguments object

Méthodes publiques

Méthode Description
CommandLineAction ( Action actionHandler ) : System

Creates a new command line action given an implementation.

Equals ( object obj ) : bool

Determines if 2 actions are the same based on their source.

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

Finds the first CommandLineArgument that matches the given key.

ToString ( ) : string

Gets a string representation of this action.

Private Methods

Méthode Description
CommandLineAction ( ) : System
Create ( MethodInfo actionMethod, List knownAliases ) : CommandLineAction
Create ( PropertyInfo actionProperty, List knownAliases ) : CommandLineAction
IsActionImplementation ( MethodInfo method ) : bool
IsActionImplementation ( PropertyInfo property ) : bool
IsMatch ( string actionString ) : bool
MakeUsageSummary ( bool htmlEncodeBrackets = false ) : string
PopulateArguments ( object parent, object &parameters ) : object

Method Details

CommandLineAction() public méthode

Creates a new command line action given an implementation.
public CommandLineAction ( Action actionHandler ) : System
actionHandler Action The implementation of the action.
Résultat System

Equals() public méthode

Determines if 2 actions are the same based on their source.
public Equals ( object obj ) : bool
obj object The other action
Résultat bool

FindMatchingArgument() public méthode

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
Résultat CommandLineArgument

ToString() public méthode

Gets a string representation of this action.
public ToString ( ) : string
Résultat string