getopt.net
A port of getopt in pure C#.
Loading...
Searching...
No Matches
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
22 public Option(string name, ArgumentType argType, char value, string description = ""): this(name, argType, (int)value, description) {}
23
31 public Option(string name, ArgumentType argType, int value, string description = "") {
32 Name = name;
33 ArgumentType = argType;
34 Value = value;
35 Description = description;
36 }
37
47 public string? Name { get; set; }
48
52 public ArgumentType? ArgumentType { get; set; }
53
57 public int Value { get; set; }
58
62 public string? Description { get; set; }
63
64 }
65}
66
ArgumentType
Enumeration containing the argument types possible for getopt.
Represents a single long option for getopt.
Definition Option.cs:8
Option(string name, ArgumentType argType, int value, string description="")
Constructs a new instance of this struct with an int as the value type.
Definition Option.cs:31
string? Description
The description of the option.
Definition Option.cs:62
Option()
Constructs a new, empty instance of this struct.
Definition Option.cs:13
Option(string name, ArgumentType argType, char value, string description="")
Constructs a new instance of this struct with a char as the value type.
Definition Option.cs:22
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