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
public class Argument<T> : System.CommandLine.Argument
type Argument<'T> = class
    inherit Argument
Public Class Argument(Of T)
Inherits Argument

Type Parameters

T
Inheritance
Argument<T>

Constructors

Name Description
Argument<T>(String)

Initializes a new instance of the Argument class.

Properties

Name Description
Arity

Gets or sets the arity of 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

Specifies if a default value is defined for the 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)
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

Gets or sets the Type that the argument's parsed tokens will be converted to.

Methods

Name Description
GetCompletions(CompletionContext)

Gets completions for the symbol.

(Inherited from Argument)
GetDefaultValue()

Gets the default value for the argument.

(Inherited from Argument)
ToString()

Returns a string that represents the current object.

(Inherited from Argument)

Extension Methods

Name Description
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.

Applies to