getopt.net
A port of getopt in pure C#.
Loading...
Searching...
No Matches
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.
 
 Option (string name, ArgumentType argType, char value, string description="")
 Constructs a new instance of this struct with a char as the value type.
 
 Option (string name, ArgumentType argType, int value, string description="")
 Constructs a new instance of this struct with an int as the value type.
 

Properties

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

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,
string  description = "" 
)
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.
descriptionThe description of the option.

Definition at line 22 of file Option.cs.

22: this(name, argType, (int)value, description) {}

◆ Option() [3/3]

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

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

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

Definition at line 31 of file Option.cs.

31 {
32 Name = name;
33 ArgumentType = argType;
34 Value = value;
35 Description = description;
36 }
string? Description
The description of the option.
Definition Option.cs:62
ArgumentType? ArgumentType
The type of argument this option requires.
Definition Option.cs:52
int Value
The value (short opt) for the option.
Definition Option.cs:57
string? Name
The name of the (long) option.
Definition Option.cs:47

References getopt.net.Option.Description, 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 52 of file Option.cs.

52{ get; set; }

◆ Description

string? getopt.net.Option.Description
getset

The description of the option.

Definition at line 62 of file Option.cs.

62{ get; set; }

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

◆ Name

string? getopt.net.Option.Name
getset

The name of the (long) option.

Do not prefix this with dashes.

help

Definition at line 47 of file Option.cs.

47{ get; set; }

Referenced by getopt.net.Extensions.FindOptionOrDefault(), and getopt.net.Option.Option().

◆ Value

int getopt.net.Option.Value
getset

The value (short opt) for the option.

Definition at line 57 of file Option.cs.

57{ get; set; }

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


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