C# Class Crisis.CommandLine.UsageInfo

Represents the properties of a CommandLineManagerAttribute (or rather the object to which its applied) that describe the command line syntax.
This class is the only way to programatically set usage descriptions, group names and similar, which is required if globalization of the usage description is desired. Users can not instantiate objects of this class, but they are retrieved by the CommandLineParser.UsageInfo property.
Afficher le fichier Open project: teeknofil/Crisis-Wordlist-Generator Class Usage Examples

Méthodes publiques

Méthode Description
GetErrorsAsString ( int width ) : string

Gets the list of errors as a formatted string.

GetGroup ( string id ) : OptionGroupInfo

Gets the option group with the specified id.

GetHeaderAsString ( int width ) : string

Gets a string consisting of the program name, version and copyright notice.

This string is suitable for printing as the first output of a console application.

GetOption ( string name ) : OptionInfo

Gets the option with the specified name.

GetOptionsAsString ( int width ) : string

Gets a formatted string describing the options and groups available.

GetOptionsAsString ( int nameColumnWidth, int descriptionColumnWidth ) : string

Gets a string describing all the options of this option manager. Usable for displaying as a help message to the user, provided that descriptions for all options and groups are provided.

ToString ( ) : string

Returns a that represents the current .

This is equivalent to calling ToString(78)

ToString ( int width ) : string

Converts this UsageInfo instance to a string.

ToString ( int width, bool includeErrors ) : string

Converts this UsageInfo instance to a string.

Private Methods

Méthode Description
UsageInfo ( IOption>.SCG options, OptionStyles optionStyles, CommandLineParser parser ) : System

Initializes a new instance of the UsageInfo class.

Method Details

GetErrorsAsString() public méthode

Gets the list of errors as a formatted string.
public GetErrorsAsString ( int width ) : string
width int The width of the field in which to format the error list.
Résultat string

GetGroup() public méthode

Gets the option group with the specified id.
public GetGroup ( string id ) : OptionGroupInfo
id string The id of the option group to retrieve.
Résultat OptionGroupInfo

GetHeaderAsString() public méthode

Gets a string consisting of the program name, version and copyright notice.
This string is suitable for printing as the first output of a console application.
public GetHeaderAsString ( int width ) : string
width int The total width in characters in which the string should be fitted
Résultat string

GetOption() public méthode

Gets the option with the specified name.
public GetOption ( string name ) : OptionInfo
name string The name of the option to retrieve.
Résultat OptionInfo

GetOptionsAsString() public méthode

Gets a formatted string describing the options and groups available.
The specified width was too small to generate the requested list.
public GetOptionsAsString ( int width ) : string
width int The maximum width of each line in the returned string.
Résultat string

GetOptionsAsString() public méthode

Gets a string describing all the options of this option manager. Usable for displaying as a help message to the user, provided that descriptions for all options and groups are provided.
public GetOptionsAsString ( int nameColumnWidth, int descriptionColumnWidth ) : string
nameColumnWidth int The width in characters of the column holding the names of the options.
descriptionColumnWidth int The width in characters of the column holding the descriptions of the options.
Résultat string

ToString() public méthode

Returns a that represents the current .
This is equivalent to calling ToString(78)
public ToString ( ) : string
Résultat string

ToString() public méthode

Converts this UsageInfo instance to a string.
public ToString ( int width ) : string
width int The width of the field (in characters) in which to format the usage description.
Résultat string

ToString() public méthode

Converts this UsageInfo instance to a string.
public ToString ( int width, bool includeErrors ) : string
width int The width of the field (in characters) in which to format the usage description.
includeErrors bool if set to true any errors that occured during parsing the command line will be included /// in the output.
Résultat string