virtualSoC  0.6.2
baskett
DotArgs.OptionArgument Class Reference

An argument that can have any value. More...

+ Inheritance diagram for DotArgs.OptionArgument:

Public Member Functions

 OptionArgument (string defaultValue, bool required=false)
 Initializes a new instance of the OptionArgument class. More...
 
 OptionArgument (string defaultValue, bool required=false)
 Initializes a new instance of the OptionArgument class. More...
 
 OptionArgument (string defaultValue, bool required=false)
 Initializes a new instance of the OptionArgument class. More...
 
virtual object GetValue ()
 Gets the value of this argument. More...
 
virtual object GetValue ()
 Gets the value of this argument. More...
 
virtual object GetValue ()
 Gets the value of this argument. More...
 
virtual void Reset ()
 Resets this argument. More...
 
virtual void Reset ()
 Resets this argument. More...
 
virtual void Reset ()
 Resets this argument. More...
 
virtual void SetValue (object value)
 Sets the value for this argument. More...
 
virtual void SetValue (object value)
 Sets the value for this argument. More...
 
virtual void SetValue (object value)
 Sets the value for this argument. More...
 

Properties

object DefaultValue [get, set]
 The default value that will be used if no value was passed on the command line. More...
 
string HelpMessage [get, set]
 The message that will be displayed in the help page for your program. More...
 
string HelpPlaceholder [get, set]
 Value that will be shown (in upper case) in the usage page for this argument. Setting this to null will display the default value (i.e. OPTION, COLLECTION, etc.). More...
 
bool IsRequired [get, protected set]
 Flag indicating whether this argument is required, i.e. must be provided via the command line. More...
 
bool NeedsValue [get, protected set]
 Indicates whether this argument requires an explicit option. More...
 
Action< object > Processor [get, set]
 A method that can be executed when the command line arguments are processed. More...
 
bool SupportsMultipleValues [get, protected set]
 Flag indicating whether multplie calls to SetValue will add a value or overwrite the existing one. More...
 
Func< object, bool > Validator [get, set]
 A method that can be used to validate a value for this argument. More...
 

Detailed Description

An argument that can have any value.

An option can be specified by passing -OPTION VALUE , -OPTION=VALUE , -OPTION:VALUE , –OPTION VALUE , –OPTION=VALUE , –OPTION:VALUE , /OPTION VALUE , /OPTION:VALUE or /OPTION=VALUE from the command line

Constructor & Destructor Documentation

◆ OptionArgument() [1/3]

DotArgs.OptionArgument.OptionArgument ( string  defaultValue,
bool  required = false 
)

Initializes a new instance of the OptionArgument class.

Parameters
defaultValueThe default value.
requiredFlag indicating whether this argument is required.
738  : base( defaultValue, required )
739  {
740  HelpPlaceholder = "OPTION";
741  NeedsValue = true;
742  }
bool NeedsValue
Indicates whether this argument requires an explicit option.
Definition: CommandLineArgs.cs:151
string HelpPlaceholder
Value that will be shown (in upper case) in the usage page for this argument. Setting this to null wi...
Definition: CommandLineArgs.cs:143

◆ OptionArgument() [2/3]

DotArgs.OptionArgument.OptionArgument ( string  defaultValue,
bool  required = false 
)

Initializes a new instance of the OptionArgument class.

Parameters
defaultValueThe default value.
requiredFlag indicating whether this argument is required.
738  : base( defaultValue, required )
739  {
740  HelpPlaceholder = "OPTION";
741  NeedsValue = true;
742  }
bool NeedsValue
Indicates whether this argument requires an explicit option.
Definition: CommandLineArgs.cs:151
string HelpPlaceholder
Value that will be shown (in upper case) in the usage page for this argument. Setting this to null wi...
Definition: CommandLineArgs.cs:143

◆ OptionArgument() [3/3]

DotArgs.OptionArgument.OptionArgument ( string  defaultValue,
bool  required = false 
)

Initializes a new instance of the OptionArgument class.

Parameters
defaultValueThe default value.
requiredFlag indicating whether this argument is required.
738  : base( defaultValue, required )
739  {
740  HelpPlaceholder = "OPTION";
741  NeedsValue = true;
742  }
bool NeedsValue
Indicates whether this argument requires an explicit option.
Definition: CommandLineArgs.cs:151
string HelpPlaceholder
Value that will be shown (in upper case) in the usage page for this argument. Setting this to null wi...
Definition: CommandLineArgs.cs:143

Member Function Documentation

◆ GetValue() [1/3]

virtual object DotArgs.Argument.GetValue ( )
virtualinherited

Gets the value of this argument.

Returns
The argument's value.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.AliasArgument, DotArgs.AliasArgument, and DotArgs.AliasArgument.

106  {
107  return Value;
108  }

◆ GetValue() [2/3]

virtual object DotArgs.Argument.GetValue ( )
virtualinherited

Gets the value of this argument.

Returns
The argument's value.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.AliasArgument, DotArgs.AliasArgument, and DotArgs.AliasArgument.

106  {
107  return Value;
108  }

◆ GetValue() [3/3]

virtual object DotArgs.Argument.GetValue ( )
virtualinherited

Gets the value of this argument.

Returns
The argument's value.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.AliasArgument, DotArgs.AliasArgument, and DotArgs.AliasArgument.

106  {
107  return Value;
108  }

◆ Reset() [1/3]

virtual void DotArgs.Argument.Reset ( )
virtualinherited

Resets this argument.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, and DotArgs.CollectionArgument.

112  {
113  Value = DefaultValue;
114  }
object DefaultValue
The default value that will be used if no value was passed on the command line.
Definition: CommandLineArgs.cs:134

◆ Reset() [2/3]

virtual void DotArgs.Argument.Reset ( )
virtualinherited

Resets this argument.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, and DotArgs.CollectionArgument.

112  {
113  Value = DefaultValue;
114  }
object DefaultValue
The default value that will be used if no value was passed on the command line.
Definition: CommandLineArgs.cs:134

◆ Reset() [3/3]

virtual void DotArgs.Argument.Reset ( )
virtualinherited

Resets this argument.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, and DotArgs.CollectionArgument.

112  {
113  Value = DefaultValue;
114  }
object DefaultValue
The default value that will be used if no value was passed on the command line.
Definition: CommandLineArgs.cs:134

◆ SetValue() [1/3]

virtual void DotArgs.Argument.SetValue ( object  value)
virtualinherited

Sets the value for this argument.

Parameters
valueThe value to set.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.AliasArgument, DotArgs.AliasArgument, and DotArgs.AliasArgument.

119  {
120  Value = value;
121  }

◆ SetValue() [2/3]

virtual void DotArgs.Argument.SetValue ( object  value)
virtualinherited

Sets the value for this argument.

Parameters
valueThe value to set.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.AliasArgument, DotArgs.AliasArgument, and DotArgs.AliasArgument.

119  {
120  Value = value;
121  }

◆ SetValue() [3/3]

virtual void DotArgs.Argument.SetValue ( object  value)
virtualinherited

Sets the value for this argument.

Parameters
valueThe value to set.

Reimplemented in DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.CollectionArgument, DotArgs.AliasArgument, DotArgs.AliasArgument, and DotArgs.AliasArgument.

119  {
120  Value = value;
121  }

Property Documentation

◆ DefaultValue

object DotArgs.Argument.DefaultValue
getsetinherited

The default value that will be used if no value was passed on the command line.

Using this when IsRequired is set will have no effect.

◆ HelpMessage

string DotArgs.Argument.HelpMessage
getsetinherited

The message that will be displayed in the help page for your program.

◆ HelpPlaceholder

string DotArgs.Argument.HelpPlaceholder
getsetinherited

Value that will be shown (in upper case) in the usage page for this argument. Setting this to null will display the default value (i.e. OPTION, COLLECTION, etc.).

◆ IsRequired

bool DotArgs.Argument.IsRequired
getprotected setinherited

Flag indicating whether this argument is required, i.e. must be provided via the command line.

◆ NeedsValue

bool DotArgs.Argument.NeedsValue
getprotected setinherited

Indicates whether this argument requires an explicit option.

◆ Processor

Action< object > DotArgs.Argument.Processor
getsetinherited

A method that can be executed when the command line arguments are processed.

◆ SupportsMultipleValues

bool DotArgs.Argument.SupportsMultipleValues
getprotected setinherited

Flag indicating whether multplie calls to SetValue will add a value or overwrite the existing one.

◆ Validator

Func< object, bool > DotArgs.Argument.Validator
getsetinherited

A method that can be used to validate a value for this argument.


The documentation for this class was generated from the following file: