getopt.net
A port of getopt in pure C#.
getopt.net.Option Struct Reference

Represents a single long option for getopt. More...

Public Member Functions

 Option ()
 Constructs a new, empty instance of this struct. More...
 
 Option (string name, ArgumentType argType, char value)
 Constructs a new instance of this struct with a char as the value type. More...
 
 Option (string name, ArgumentType argType, int value)
 Constructs a new instance of this struct with an int as the value type. More...
 

Properties

string? Name [get, set]
 The name of the (long) option More...
 
ArgumentTypeArgumentType [get, set]
 The type of argument this option requires. More...
 
int Value [get, set]
 The value (short opt) for the option. More...
 

Detailed Description

Represents a single long option for getopt.

Definition at line 8 of file Option.cs.

Constructor & Destructor Documentation

◆ Option() [1/3]

getopt.net.Option.Option ( )
inline

Constructs a new, empty instance of this struct.

Definition at line 13 of file Option.cs.

13{ }

◆ Option() [2/3]

getopt.net.Option.Option ( string  name,
ArgumentType  argType,
char  value 
)
inline

Constructs a new instance of this struct with a char as the value type.

Parameters
nameThe name of the argument.
argTypeThe argument type.
valueThe value of the option.

Definition at line 21 of file Option.cs.

21: this(name, argType, (int)value) { }

◆ Option() [3/3]

getopt.net.Option.Option ( string  name,
ArgumentType  argType,
int  value 
)
inline

Constructs a new instance of this struct with an int as the value type.

Parameters
name
argType
value

Definition at line 29 of file Option.cs.

29 {
30 Name = name;
31 ArgumentType = argType;
32 Value = value;
33 }
ArgumentType? ArgumentType
The type of argument this option requires.
Definition: Option.cs:49
int Value
The value (short opt) for the option.
Definition: Option.cs:54
string? Name
The name of the (long) option
Definition: Option.cs:44

References getopt.net.Option.Name, and getopt.net.Option.Value.

Property Documentation

◆ ArgumentType

ArgumentType? getopt.net.Option.ArgumentType
getset

The type of argument this option requires.

Definition at line 49 of file Option.cs.

49{ get; set; }

◆ Name

string? getopt.net.Option.Name
getset

The name of the (long) option

Do not prefix this with dashes.

help

Definition at line 44 of file Option.cs.

44{ get; set; }

Referenced by getopt.net.Option.Option().

◆ Value

int getopt.net.Option.Value
getset

The value (short opt) for the option.

Definition at line 54 of file Option.cs.

54{ get; set; }

Referenced by getopt.net.Option.Option().


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