getopt.net
A port of getopt in pure C#.
getopt.net.CommandOption Class Reference

Represents a single argument received via command-line options. More...

Public Member Functions

 CommandOption ()
 Default constructor. More...
 
 CommandOption (int optChar, object? optArg=null)
 Object constructor - instantiates a new instance of this class. More...
 

Properties

int OptChar [get, set]
 The option character that was received. More...
 
Type? ArgumentType [get, set]
 The type of the argument that was received. More...
 
object? OptionArgument [get, set]
 The actual argument passed to the application. More...
 

Detailed Description

Represents a single argument received via command-line options.

Definition at line 8 of file CommandOption.cs.

Constructor & Destructor Documentation

◆ CommandOption() [1/2]

getopt.net.CommandOption.CommandOption ( )
inline

Default constructor.

Definition at line 13 of file CommandOption.cs.

13{ }

◆ CommandOption() [2/2]

getopt.net.CommandOption.CommandOption ( int  optChar,
object?  optArg = null 
)
inline

Object constructor - instantiates a new instance of this class.

Parameters
optCharThe value of the option passed.
optArgThe option's argument (if any)

Definition at line 20 of file CommandOption.cs.

20 {
21 ArgumentType = optArg?.GetType();
22 OptionArgument = optArg;
23 }
object? OptionArgument
The actual argument passed to the application.
Type? ArgumentType
The type of the argument that was received.

References getopt.net.CommandOption.OptionArgument.

Property Documentation

◆ ArgumentType

Type? getopt.net.CommandOption.ArgumentType
getset

The type of the argument that was received.

Possible types are int, string, bool, double

Definition at line 35 of file CommandOption.cs.

35{ get; set; }

◆ OptChar

int getopt.net.CommandOption.OptChar
getset

The option character that was received.

Definition at line 28 of file CommandOption.cs.

28{ get; set; }

◆ OptionArgument

object? getopt.net.CommandOption.OptionArgument
getset

The actual argument passed to the application.

Definition at line 40 of file CommandOption.cs.

40{ get; set; }

Referenced by getopt.net.CommandOption.CommandOption().


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