Class CommandLineArgParser
A class for common operations around resolving command line arguments
Inherited Members
Namespace: LemonEdge.Utils
Assembly: LemonEdge.Utils.dll
Syntax
public class CommandLineArgParser
Constructors
CommandLineArgParser(CommandLineArgOptions, string[])
Creates a a command line parser with the specified options
Declaration
public CommandLineArgParser(CommandLineArgOptions options, string[] args)
Parameters
| Type | Name | Description |
|---|---|---|
| CommandLineArgOptions | options | The options for the parameters to be parsed |
| string[] | args | The list of args from the main command line method |
Methods
GetOptionArgument(string, short)
Returns the argument associated with the specified option parsed from the command line arguments
Declaration
public string GetOptionArgument(string optionName, short argumentIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| string | optionName | The name of the option to return an argument for |
| short | argumentIndex | The index (0 based) of the argument to return for this option |
Returns
| Type | Description |
|---|---|
| string | The argument associated with the specified option parsed from the command line arguments |
HasOption(string)
Returns true if the specified option has been included in the parsed arguments
Declaration
public bool HasOption(string optionName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | optionName | The name of the option to check for in the parsed arguments |
Returns
| Type | Description |
|---|---|
| bool | True if the specified option has been included in the parsed arguments |