Argument<T> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
generic <typename T>
public ref class Argument : System::CommandLine::Argument
generic <typename T>
public ref class Argument : System::CommandLine::Argument, System::CommandLine::Binding::IValueDescriptor<T>
public class Argument<T> : System.CommandLine.Argument
public class Argument<T> : System.CommandLine.Argument, System.CommandLine.Binding.IValueDescriptor<T>
type Argument<'T> = class
inherit Argument
type Argument<'T> = class
inherit Argument
interface IValueDescriptor<'T>
interface IValueDescriptor
Public Class Argument(Of T)
Inherits Argument
Public Class Argument(Of T)
Inherits Argument
Implements IValueDescriptor(Of T)
Type Parameters
- T
- Inheritance
- Implements
Constructors
| Argument<T>() |
Initializes a new instance of the Argument class. |
| Argument<T>(Func<T>) |
Initializes a new instance of the Argument class. |
| Argument<T>(ParseArgument<T>, Boolean) |
Initializes a new instance of the Argument class. |
| Argument<T>(String, Func<T>, String) |
Initializes a new instance of the Argument class. |
| Argument<T>(String, ParseArgument<T>, Boolean, String) |
Initializes a new instance of the Argument class. |
| Argument<T>(String, String) |
Initializes a new instance of the Argument class. |
| Argument<T>(String) |
Initializes a new instance of the Argument class. |
Properties
| Arity |
Gets or sets the arity of the argument. (Inherited from Argument) |
| Completions |
Gets the list of completion sources for the argument. (Inherited from Argument) |
| CompletionSources |
Gets the list of completion sources for the argument. (Inherited from Argument) |
| CustomParser |
A custom argument parser. |
| DefaultValueFactory |
The delegate to invoke to create the default value. |
| Description |
Gets or sets the description of the symbol. (Inherited from Symbol) |
| HasDefaultValue |
Gets a value determining whether there is a default value. |
| HasDefaultValue |
Specifies if a default value is defined for the argument. (Inherited from Argument) |
| HelpName |
The name used in help output to describe the argument. (Inherited from Argument) |
| Hidden |
Gets or sets a value indicating whether the symbol is hidden. (Inherited from Symbol) |
| IsHidden |
Gets or sets a value indicating whether the symbol is hidden. (Inherited from Symbol) |
| Name |
Gets the name of the symbol. (Inherited from Symbol) |
| Parents |
Gets the parent symbols. (Inherited from Symbol) |
| Validators |
Provides a list of argument validators. Validators can be used to provide custom errors based on user input. (Inherited from Argument) |
| ValueType |
The type of the value. |
Methods
| AddValidator(ValidateSymbolResult<ArgumentResult>) |
Adds a custom ValidateSymbolResult<T> to the argument. Validators can be used to provide custom errors based on user input. (Inherited from Argument) |
| GetCompletions() |
Gets completions for the symbol. (Inherited from Symbol) |
| GetCompletions(CompletionContext) |
Gets completions for the symbol. (Inherited from Argument) |
| GetDefaultValue() |
Gets the default value for the argument. (Inherited from Argument) |
| SetDefaultValue(Object) |
Sets the default value for the argument. (Inherited from Argument) |
| SetDefaultValueFactory(Func<ArgumentResult,Object>) |
Sets a delegate to invoke when the default value for the argument is required. (Inherited from Argument) |
| SetDefaultValueFactory(Func<Object>) |
Sets a delegate to invoke when the default value for the argument is required. (Inherited from Argument) |
| ToString() |
Returns a string that represents the current object. (Inherited from Argument) |
Explicit Interface Implementations
| IValueDescriptor.ValueName |
Gets the name of the value. (Inherited from Argument) |
Extension Methods
| ExistingOnly<T>(Argument<T>) |
Configures an argument to accept only values corresponding to a existing files or directories. |
| Parse(Argument, String) |
Parses a command line string value using an argument. |
| Parse(Argument, String[]) |
Parses a command line string value using an argument. |
| AcceptExistingOnly<T>(Argument<T>) |
Configures an argument to accept only values corresponding to a existing files or directories. |
| AcceptLegalFileNamesOnly<T>(Argument<T>) |
Configures the argument to accept only values representing legal file names. |
| AcceptLegalFilePathsOnly<T>(Argument<T>) |
Configures the argument to accept only values representing legal file paths. |
| AcceptOnlyFromAmong<T>(Argument<T>, String[]) |
Configures the argument to accept only the specified values, and to suggest them as command line completions. |