Bewerken

Delen via


Argument Class

Definition

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

public ref class Argument : System::CommandLine::Symbol, System::CommandLine::Binding::IValueDescriptor
public class Argument : System.CommandLine.Symbol, System.CommandLine.Binding.IValueDescriptor
type Argument = class
    inherit Symbol
    interface IValueDescriptor
Public Class Argument
Inherits Symbol
Implements IValueDescriptor
Inheritance
Argument
Derived
Implements

Constructors

Argument()

Initializes a new instance of the Argument class.

Argument(String, String)

Initializes a new instance of the Argument class.

Properties

Arity

Gets or sets the arity of the argument.

Completions

Gets the list of completion sources for the argument.

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.

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

Gets or sets the Type that the argument token(s) will be converted to.

Methods

AddValidator(ValidateSymbolResult<ArgumentResult>)

Adds a custom ValidateSymbolResult<T> to the argument. Validators can be used to provide custom errors based on user input.

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.

GetDefaultValue()

Gets the default value for the 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.

SetDefaultValueFactory(Func<ArgumentResult,Object>)

Sets a delegate to invoke when the default value for the argument is required.

SetDefaultValueFactory(Func<Object>)

Sets a delegate to invoke when the default value for the argument is required.

ToString()

Returns a string that represents the current object.

Explicit Interface Implementations

IValueDescriptor.ValueName

Gets the name of the value.

Extension Methods

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