C# Класс 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'.
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
CommandLineAction System
Create CommandLineAction
Create CommandLineAction
IsActionImplementation bool
IsActionImplementation bool
IsMatch bool
MakeUsageSummary string
PopulateArguments object

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CommandLineAction() публичный метод

Creates a new command line action given an implementation.
public CommandLineAction ( Action actionHandler ) : System
actionHandler Action The implementation of the action.
Результат System

Equals() публичный метод

Determines if 2 actions are the same based on their source.
public Equals ( object obj ) : bool
obj object The other action
Результат bool

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 string representation of this action.
public ToString ( ) : string
Результат string