Class CommandLineArgument
Defines an abstract base class for command line arguments.
Inherited Members
Namespace: Juhta.Net.Console
Assembly: Juhta.Net.Console.dll
Syntax
public abstract class CommandLineArgument
Constructors
| Improve this Doc View SourceCommandLineArgument(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 SourceConsumed
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.
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 SourceGetValueAs<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. |
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. |