Show / Hide Table of Contents

Class CommandLineArgument

Defines an abstract base class for command line arguments.

Inheritance
System.Object
CommandLineArgument
NameValueArgument
PlainArgument
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Juhta.Net.Console
Assembly: Juhta.Net.Console.dll
Syntax
public abstract class CommandLineArgument

Constructors

| Improve this Doc View Source

CommandLineArgument(String)

Initializes a new instance.

Declaration
protected CommandLineArgument(string value)
Parameters
Type Name Description
System.String value

Specifies a value for the Value property.

Properties

| Improve this Doc View Source

Consumed

Gets or sets (internal) a boolean value determining whether this CommandLineArgument has been consumed.

Declaration
public bool Consumed { get; }
Property Value
Type Description
System.Boolean
Remarks

A CommandLineArgument becomes consumed when it is fetched from a CommandLineParser.

| Improve this Doc View Source

Value

Gets the value of the command line argument.

Declaration
public string Value { get; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

GetValueAs<T>()

Converts the value of this command line argument to a specified type.

Declaration
public T GetValueAs<T>()
Returns
Type Description
T

Returns the value of this command line argument converted to the specified type.

Type Parameters
Name Description
T

Specifies a type to which to convert the value.

| Improve this Doc View Source

GetValueAs<T>(IValidator<T>)

Converts the value of this command line argument to a specified type and validates the converted value with a specified validator.

Declaration
public T GetValueAs<T>(IValidator<T> validator)
Parameters
Type Name Description
IValidator<T> validator

Specifies a validator.

Returns
Type Description
T

Returns the value of this command line argument converted to the specified type.

Type Parameters
Name Description
T

Specifies a type to which to convert the value.

  • Improve this Doc
  • View Source
Back to top Copyright © 2017-2019 Juha Lähteenmäki
Generated by DocFX