virtualSoC  0.6.2
baskett
DotArgs.FlagArgument Class Reference

A simple argument flag. More...

+ Inheritance diagram for DotArgs.FlagArgument:

Public Member Functions

 FlagArgument (bool defaultValue=false, bool required=false)
 Initializes a new instance of the FlagArgument class. More...
 
 FlagArgument (bool defaultValue=false, bool required=false)
 Initializes a new instance of the FlagArgument class. More...
 
 FlagArgument (bool defaultValue=false, bool required=false)
 Initializes a new instance of the FlagArgument 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

A simple argument flag.

A flag can be specified by passing -FLAG , –flag or /FLAG from the command line.

Constructor & Destructor Documentation

◆ FlagArgument() [1/3]

DotArgs.FlagArgument.FlagArgument ( bool  defaultValue = false,
bool  required = false 
)

Initializes a new instance of the FlagArgument class.

Parameters
defaultValueThe default value for this flag.
requiredFlag indicating whether this argument is required.
689  : base( defaultValue, required )
690  {
691  if( IsRequired )
692  {
693  DefaultValue = null;
694  }
695  }
object DefaultValue
The default value that will be used if no value was passed on the command line.
Definition: CommandLineArgs.cs:134
bool IsRequired
Flag indicating whether this argument is required, i.e. must be provided via the command line...
Definition: CommandLineArgs.cs:148

◆ FlagArgument() [2/3]

DotArgs.FlagArgument.FlagArgument ( bool  defaultValue = false,
bool  required = false 
)

Initializes a new instance of the FlagArgument class.

Parameters
defaultValueThe default value for this flag.
requiredFlag indicating whether this argument is required.
689  : base( defaultValue, required )
690  {
691  if( IsRequired )
692  {
693  DefaultValue = null;
694  }
695  }
object DefaultValue
The default value that will be used if no value was passed on the command line.
Definition: CommandLineArgs.cs:134
bool IsRequired
Flag indicating whether this argument is required, i.e. must be provided via the command line...
Definition: CommandLineArgs.cs:148

◆ FlagArgument() [3/3]

DotArgs.FlagArgument.FlagArgument ( bool  defaultValue = false,
bool  required = false 
)

Initializes a new instance of the FlagArgument class.

Parameters
defaultValueThe default value for this flag.
requiredFlag indicating whether this argument is required.
689  : base( defaultValue, required )
690  {
691  if( IsRequired )
692  {
693  DefaultValue = null;
694  }
695  }
object DefaultValue
The default value that will be used if no value was passed on the command line.
Definition: CommandLineArgs.cs:134
bool IsRequired
Flag indicating whether this argument is required, i.e. must be provided via the command line...
Definition: CommandLineArgs.cs:148

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: