getopt.net
A port of getopt in pure C#.
Option.cs
Go to the documentation of this file.
1using System;
2
3namespace getopt.net {
4
8 public struct Option {
9
13 public Option() { }
14
21 public Option(string name, ArgumentType argType, char value): this(name, argType, (int)value) { }
22
29 public Option(string name, ArgumentType argType, int value) {
30 Name = name;
31 ArgumentType = argType;
32 Value = value;
33 }
34
44 public string? Name { get; set; }
45
49 public ArgumentType? ArgumentType { get; set; }
50
54 public int Value { get; set; }
55
56 }
57}
58
ArgumentType
Enumeration containing the argument types possible for getopt.
Definition: ArgumentType.cs:8
Represents a single long option for getopt.
Definition: Option.cs:8
Option(string name, ArgumentType argType, int value)
Constructs a new instance of this struct with an int as the value type.
Definition: Option.cs:29
Option(string name, ArgumentType argType, char value)
Constructs a new instance of this struct with a char as the value type.
Definition: Option.cs:21
Option()
Constructs a new, empty instance of this struct.
Definition: Option.cs:13
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