getopt.net
A port of getopt in pure C#.
CommandOption.cs
Go to the documentation of this file.
1using System;
2
3namespace getopt.net {
4
8 public class CommandOption {
9
13 public CommandOption() { }
14
20 public CommandOption(int optChar, object? optArg = null) {
21 ArgumentType = optArg?.GetType();
22 OptionArgument = optArg;
23 }
24
28 public int OptChar { get; set; }
29
35 public Type? ArgumentType { get; set; }
36
40 public object? OptionArgument { get; set; }
41
42 }
43}
Represents a single argument received via command-line options.
Definition: CommandOption.cs:8
CommandOption()
Default constructor.
object? OptionArgument
The actual argument passed to the application.
CommandOption(int optChar, object? optArg=null)
Object constructor - instantiates a new instance of this class.
int OptChar
The option character that was received.
ArgumentType
Enumeration containing the argument types possible for getopt.
Definition: ArgumentType.cs:8