แก้ไข

แชร์ผ่าน


Argument<T> Class

Definition

A symbol defining a value that can be passed on the command line to a command or option.

generic <typename T>
public ref class Argument : System::CommandLine::Argument, System::CommandLine::Binding::IValueDescriptor<T>
public class Argument<T> : System.CommandLine.Argument, System.CommandLine.Binding.IValueDescriptor<T>
type Argument<'T> = class
    inherit Argument
    interface IValueDescriptor<'T>
    interface IValueDescriptor
Public Class Argument(Of T)
Inherits Argument
Implements IValueDescriptor(Of T)

Type Parameters

T
Inheritance
Argument<T>
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.

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)
Description

Gets or sets the description of the symbol.

(Inherited from Symbol)
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)
IsHidden

Gets or sets a value indicating whether the symbol is hidden.

(Inherited from Symbol)
Name

Gets or sets the name of the symbol.

(Inherited from Symbol)
Parents

Gets the parent symbols.

(Inherited from Symbol)
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)
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetCompletions()

Gets completions for the symbol.

(Inherited from Symbol)
GetCompletions(CompletionContext)

Gets the suggested values for command line completion.

(Inherited from Argument)
GetDefaultValue()

Gets the default value for the argument.

(Inherited from Argument)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
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.

Applies to